pub struct Or<I1, I2, M> { /* private fields */ }Expand description
Provides a fallback initializer if the primary one fails.
This initializer is created by calling the InitPin::or method or by
using the or() factory function.
Trait Implementations§
Source§impl<T: ?Sized, I1, M, I2> InitPin<T> for Or<I1, I2, M>
impl<T: ?Sized, I1, M, I2> InitPin<T> for Or<I1, I2, M>
Source§fn init_pin<'a, 'b>(
self,
place: Uninit<'a, T>,
slot: DropSlot<'a, 'b, T>,
) -> InitPinResult<'a, 'b, T, I1::Error>
fn init_pin<'a, 'b>( self, place: Uninit<'a, T>, slot: DropSlot<'a, 'b, T>, ) -> InitPinResult<'a, 'b, T, I1::Error>
Initializes a place with a pinned value. Read more
Source§fn and_pin<F: FnOnce(Pin<&mut T>)>(self, f: F) -> AndPin<Self, F>
fn and_pin<F: FnOnce(Pin<&mut T>)>(self, f: F) -> AndPin<Self, F>
Chains a closure to execute after successful initialization with a
pinned reference. Read more
Source§fn or<M, I2>(self, other: I2) -> Or<Self, I2, M>
fn or<M, I2>(self, other: I2) -> Or<Self, I2, M>
Provides a fallback initializer if this one fails. Read more
Source§fn or_else<F, I2>(self, f: F) -> OrElse<Self, F>
fn or_else<F, I2>(self, f: F) -> OrElse<Self, F>
Provides a fallback initializer based on the error from this one. Read more
Source§fn unwrap_or<M, I2>(self, other: I2) -> UnwrapOr<Self, I2, M>where
I2: IntoInitPin<T, M, Error = Infallible>,
fn unwrap_or<M, I2>(self, other: I2) -> UnwrapOr<Self, I2, M>where
I2: IntoInitPin<T, M, Error = Infallible>,
Provides a fallback initializer if the primary one fails. The fallback
initializer must be infallible. Read more
Source§fn unwrap_or_else<F, I2>(self, f: F) -> UnwrapOrElse<Self, F>
fn unwrap_or_else<F, I2>(self, f: F) -> UnwrapOrElse<Self, F>
Provides a fallback initializer computed from the error of the primary
one. The fallback initializer must be infallible. Read more
Source§impl<I1, I2, M> Initializer for Or<I1, I2, M>where
I1: Initializer,
impl<I1, I2, M> Initializer for Or<I1, I2, M>where
I1: Initializer,
Source§type Error = <I1 as Initializer>::Error
type Error = <I1 as Initializer>::Error
The error type that can occur during initialization.
Source§fn map_err<F, E2>(self, f: F) -> MapErr<Self, F>
fn map_err<F, E2>(self, f: F) -> MapErr<Self, F>
Maps the error type of the initializer using a closure. Read more
Source§fn adapt_err<E2>(self) -> MapErr<Self, impl FnOnce(Self::Error) -> E2>where
Self: Initializer<Error = Infallible>,
fn adapt_err<E2>(self) -> MapErr<Self, impl FnOnce(Self::Error) -> E2>where
Self: Initializer<Error = Infallible>,
Adapts an infallible initializer to have a different error type. Read more
impl<I1, I2, M> StructuralPartialEq for Or<I1, I2, M>
Auto Trait Implementations§
impl<I1, I2, M> Freeze for Or<I1, I2, M>
impl<I1, I2, M> RefUnwindSafe for Or<I1, I2, M>
impl<I1, I2, M> Send for Or<I1, I2, M>
impl<I1, I2, M> Sync for Or<I1, I2, M>
impl<I1, I2, M> Unpin for Or<I1, I2, M>
impl<I1, I2, M> UnwindSafe for Or<I1, I2, M>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more