#[repr(C)]pub struct mx_erased {
pub base: *const mx_base_vtable,
}Expand description
Type-erased object header.
This is the common prefix of all erased objects, providing access to the base vtable. The actual data follows this header in memory.
§Memory Layout
┌─────────────────────────────────────┐
│ mx_erased │
│ base: *const mx_base_vtable ──────┼──► static vtable
├─────────────────────────────────────┤
│ (type-specific data follows...) │
│ data: T │
│ interface_views: [...] │
└─────────────────────────────────────┘§Layout Guarantee
This type is #[repr(C)] and its layout is frozen. The base field
will always be at offset 0, and new fields will only be appended.
§Generated By
#[derive(ExternalPtr)] generates wrapper structs that place mx_erased
as the first field for proper layout.
Fields§
§base: *const mx_base_vtablePointer to the base vtable.
This must point to a valid, static vtable for the lifetime of the object.
The vtable is typically a static generated by #[derive(ExternalPtr)].
Auto Trait Implementations§
impl Freeze for mx_erased
impl RefUnwindSafe for mx_erased
impl !Send for mx_erased
impl !Sync for mx_erased
impl Unpin for mx_erased
impl UnsafeUnpin for mx_erased
impl UnwindSafe for mx_erased
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more