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.

Implementors§

source§

impl<T> InPlaceWrite<T> for UniqueArc<MaybeUninit<T>>

source§

impl<T, A> InPlaceWrite<T> for Box<MaybeUninit<T>, A>
where A: Allocator + 'static,

§

type Initialized = Box<T, A>