Init

Trait Init 

Source
pub trait Init<T, E>: Sized {
    // Required method
    fn __init<'a>(self, this: PinUninit<'a, T>) -> InitResult<'a, T, E>;

    // Provided method
    fn map_err<E2, F>(self, f: F) -> MapErr<T, E, E2, Self, F>
       where F: FnOnce(E) -> E2 { ... }
}
Expand description

Initializer that can be used to safely pin-initialize T.

A blanket implementation impl<T, E> Init<T, E> for T is provided for all types, so a non-pinned value can be used directly for pin-initialization.

Required Methods§

Source

fn __init<'a>(self, this: PinUninit<'a, T>) -> InitResult<'a, T, E>

Pin-initialize this.

Provided Methods§

Source

fn map_err<E2, F>(self, f: F) -> MapErr<T, E, E2, Self, F>
where F: FnOnce(E) -> E2,

Maps the error from E to E2.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T, E> Init<T, E> for T