CoolStruct

Struct CoolStruct 

Source
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: u8

This length controls the first two arrays.

§big_len: usize

This 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

Source

pub fn muts(self: Pin<&mut Self>) -> Muts<'_>

Mutable access to all fields simultaneously, except the header.

Source

pub fn refs(&self) -> Refs<'_>

Mutable access to all fields simultaneously, except the header.

Source

pub fn try_set_layout_controllers( self: Pin<&mut Self>, layout_controllers: LayoutControllers, ) -> Result<(), LayoutMismatch>

Trait Implementations§

Source§

impl Drop for CoolStruct

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

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>

Calculates the layout of the object, returning None if any of the calculated sizes or offsets would overflow usize. Read more
Source§

unsafe fn initialize(self, dst: NonNull<CoolStruct>, layout: VarLenLayout)

Populates the destination pointer. Read more
Source§

impl VarLen for CoolStruct

Source§

const ALIGN: usize = 8usize

Alignment of this type, including its fixed-length header. Read more
Source§

const NEEDS_VDROP: bool = false

If false, vdrop() is a noop, and may be skipped without changing behavior. Read more
Source§

type Layout = VarLenLayout

This type’s internal dynamic calculations of where its tail fields are. Read more
Source§

fn calculate_layout(&self) -> VarLenLayout

Calculates the layout of the internal fields of this object. Read more
Source§

unsafe fn vdrop(self: Pin<&mut Self>, layout: VarLenLayout)

Drops self. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.