pub struct CoolStruct {
pub small_len: u8,
pub big_len: usize,
pub arr1: ArrayMarker<u8>,
pub arr2: ArrayMarker<u8>,
pub arr3: ArrayMarker<u16>,
}Expand description
This struct contains two lengths and three arrays.
Fields§
§small_len: u8This length controls the first two arrays.
big_len: usizeThis length controls the last array.
arr1: ArrayMarker<u8>An array.
arr2: ArrayMarker<u8>Another array.
arr3: ArrayMarker<u16>A third array.
Implementations§
Source§impl CoolStruct
impl CoolStruct
Sourcepub fn muts(self: Pin<&mut Self>) -> Muts<'_>
pub fn muts(self: Pin<&mut Self>) -> Muts<'_>
Mutable access to all fields simultaneously, except the header.
pub fn try_set_layout_controllers( self: Pin<&mut Self>, layout_controllers: LayoutControllers, ) -> Result<(), LayoutMismatch>
Trait Implementations§
Source§impl Drop for CoolStruct
impl Drop for CoolStruct
Source§impl<InitArr1: ArrayInitializer<u8>, InitArr2: ArrayInitializer<u8>, InitArr3: ArrayInitializer<u16>> Initializer<CoolStruct> for Init<InitArr1, InitArr2, InitArr3>
impl<InitArr1: ArrayInitializer<u8>, InitArr2: ArrayInitializer<u8>, InitArr3: ArrayInitializer<u16>> Initializer<CoolStruct> for Init<InitArr1, InitArr2, InitArr3>
Source§fn calculate_layout_cautious(&self) -> Option<VarLenLayout>
fn calculate_layout_cautious(&self) -> Option<VarLenLayout>
Calculates the layout of the object, returning
None if any of the calculated sizes
or offsets would overflow usize. Read moreSource§unsafe fn initialize(self, dst: NonNull<CoolStruct>, layout: VarLenLayout)
unsafe fn initialize(self, dst: NonNull<CoolStruct>, layout: VarLenLayout)
Populates the destination pointer. Read more
Source§impl VarLen for CoolStruct
impl VarLen for CoolStruct
Source§const ALIGN: usize = 8usize
const ALIGN: usize = 8usize
Alignment of this type, including its fixed-length header. Read more
Source§const NEEDS_VDROP: bool = false
const NEEDS_VDROP: bool = false
Source§type Layout = VarLenLayout
type Layout = VarLenLayout
This type’s internal dynamic calculations of where its tail fields are. Read more
Source§fn calculate_layout(&self) -> VarLenLayout
fn calculate_layout(&self) -> VarLenLayout
Calculates the layout of the internal fields of this object. Read more
Auto Trait Implementations§
impl Freeze for CoolStruct
impl RefUnwindSafe for CoolStruct
impl Send for CoolStruct
impl Sync for CoolStruct
impl !Unpin for CoolStruct
impl UnwindSafe for CoolStruct
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