Trait ObjectCoreWithExtraItems

Source
pub unsafe trait ObjectCoreWithExtraItems: ObjectCore {
    type ExtraItem;

    // Required method
    fn extra_items_count(this: &Self) -> usize;

    // Provided methods
    unsafe fn extra_items(this: &Self) -> &[Self::ExtraItem] { ... }
    unsafe fn extra_items_mut(this: &mut Self) -> &mut [Self::ExtraItem] { ... }
}
Expand description

Traits for objects with extra items that follows the object

This extra trait can be helpful to implement array types and string types

Required Associated Types§

Source

type ExtraItem

type of extra items storage that follows the object

Required Methods§

Source

fn extra_items_count(this: &Self) -> usize

Return the number of extra items

Provided Methods§

Source

unsafe fn extra_items(this: &Self) -> &[Self::ExtraItem]

Return the extra items data pointer

Source

unsafe fn extra_items_mut(this: &mut Self) -> &mut [Self::ExtraItem]

Return the extra items data pointer

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§