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§
sourcetype Initialized
type Initialized
The type Self
turns into when the contents are initialized.
Required Methods§
sourcefn write_init<E>(self, init: impl Init<T, E>) -> Result<Self::Initialized, E>
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.
sourcefn write_pin_init<E>(
self,
init: impl PinInit<T, E>
) -> Result<Pin<Self::Initialized>, E>
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.