pub unsafe trait ExtendableStructure: ExtendableStructureBase + Default {
const STRUCTURE_TYPE: StructureType;
// Provided methods
unsafe fn retrieve_next(&self) -> &Cell<*const Header> { ... }
unsafe fn push_next_unchecked<T: ExtendableStructure>(&self, ext: &T) { ... }
fn new_uninit() -> MaybeUninit<Self> { ... }
}
Required Associated Constants§
Provided Methods§
Sourceunsafe fn retrieve_next(&self) -> &Cell<*const Header>
unsafe fn retrieve_next(&self) -> &Cell<*const Header>
SAFETY: Same as ExtendableStructureBase::header
Sourceunsafe fn push_next_unchecked<T: ExtendableStructure>(&self, ext: &T)
unsafe fn push_next_unchecked<T: ExtendableStructure>(&self, ext: &T)
Assuming the current structure chain is the following: Self -> Ext1 -> Ext2 -> Ext3 calling this function with Ext4 will result in: Self -> Ext4 -> Ext1 -> Ext2 -> Ext3 This function will never cause cycles in the structure chain This function is unsafe because it discards the lifetime (ExtendableStructure does not have a lifetime parameter) Also it does not check that T is a valid extension to be added to Self and only requires references (and not mutable references)
Sourcefn new_uninit() -> MaybeUninit<Self>
fn new_uninit() -> MaybeUninit<Self>
Return a unitialized structure except the structure type being correctly set and the p_next pointer being set to null
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.