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§
Required Methods§
Sourcefn extra_items_count(this: &Self) -> usize
fn extra_items_count(this: &Self) -> usize
Return the number of extra items
Provided Methods§
Sourceunsafe fn extra_items(this: &Self) -> &[Self::ExtraItem]
unsafe fn extra_items(this: &Self) -> &[Self::ExtraItem]
Return the extra items data pointer
Sourceunsafe fn extra_items_mut(this: &mut Self) -> &mut [Self::ExtraItem]
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.