Skip to main content

RawInit

Struct RawInit 

Source
pub struct RawInit<I> { /* private fields */ }
Expand description

将高级原始地址初始化器接入安全初始化入口。 Adapts an advanced raw-pointer initializer to the safe Init interface.

Implementations§

Source§

impl<I> RawInit<I>

Source

pub const fn new(initializer: I) -> Self

包装一个实现了 InitRaw 的初始化器。 Wrap an initializer that implements InitRaw.

Trait Implementations§

Source§

impl<T, E, Mode, I> Init<T, E, Mode> for RawInit<I>
where I: InitRaw<T, E, Mode>,

Source§

fn initialize<'slot>( self, slot: InitSlot<'slot, T, Mode>, ) -> Result<InitReceipt<'slot, T, Mode>, E>

消耗目标槽位并返回已初始化值的析构凭证。 Consume the target slot and return a destruction receipt for the initialized value.
Source§

fn map_err<F, E2>(self, map: F) -> MapInitError<Self, F, E, Mode>
where Self: Sized, F: FnOnce(E) -> E2,

将初始化器的错误映射为另一种错误类型,同时保留地址模式。 Map the initializer’s error to another type while preserving its address mode. Read more

Auto Trait Implementations§

§

impl<I> Freeze for RawInit<I>
where I: Freeze,

§

impl<I> RefUnwindSafe for RawInit<I>
where I: RefUnwindSafe,

§

impl<I> Send for RawInit<I>
where I: Send,

§

impl<I> Sync for RawInit<I>
where I: Sync,

§

impl<I> Unpin for RawInit<I>
where I: Unpin,

§

impl<I> UnsafeUnpin for RawInit<I>
where I: UnsafeUnpin,

§

impl<I> UnwindSafe for RawInit<I>
where I: UnwindSafe,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.