Trait kernel::init::InPlaceWrite

source ·
pub trait InPlaceWrite<T> {
    type Initialized;

    // Required methods
    fn write_init<E>(
        self,
        init: impl Init<T, E>
    ) -> Result<Self::Initialized, E>;
    fn write_pin_init<E>(
        self,
        init: impl PinInit<T, E>
    ) -> Result<Pin<Self::Initialized>, E>;
}
Expand description

Smart pointer containing uninitialized memory and that can write a value.

Required Associated Types§

source

type Initialized

The type Self turns into when the contents are initialized.

Required Methods§

source

fn write_init<E>(self, init: impl Init<T, E>) -> Result<Self::Initialized, E>

Use the given initializer to write a value into self.

Does not drop the current value and considers it as uninitialized memory.

source

fn write_pin_init<E>( self, init: impl PinInit<T, E> ) -> Result<Pin<Self::Initialized>, E>

Use the given pin-initializer to write a value into self.

Does not drop the current value and considers it as uninitialized memory.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> InPlaceWrite<T> for Box<MaybeUninit<T>>

§

type Initialized = Box<T>

source§

fn write_init<E>(self, init: impl Init<T, E>) -> Result<Self::Initialized, E>

source§

fn write_pin_init<E>( self, init: impl PinInit<T, E> ) -> Result<Pin<Self::Initialized>, E>

Implementors§