pub struct NdResult<T, E>(/* private fields */);Expand description
Conceptually, this is a Nondet<Result<T, E>>.
This newtype is necessary so that applying ? on a NdResult<T, E> yields T and not Result<T, E>.
Implementations§
Trait Implementations§
source§impl<T, E> FromResidual<Infallible> for NdResult<T, E>
impl<T, E> FromResidual<Infallible> for NdResult<T, E>
source§fn from_residual(residual: Infallible) -> Self
fn from_residual(residual: Infallible) -> Self
🔬This is a nightly-only experimental API. (
try_trait_v2)Constructs the type from a compatible
Residual type. Read moresource§impl<T, E> FromResidual<NdResult<Infallible, E>> for NdResult<T, E>
impl<T, E> FromResidual<NdResult<Infallible, E>> for NdResult<T, E>
source§fn from_residual(residual: NdResult<Infallible, E>) -> Self
fn from_residual(residual: NdResult<Infallible, E>) -> Self
🔬This is a nightly-only experimental API. (
try_trait_v2)Constructs the type from a compatible
Residual type. Read moresource§impl<T, E> FromResidual<Result<Infallible, E>> for NdResult<T, E>
impl<T, E> FromResidual<Result<Infallible, E>> for NdResult<T, E>
source§fn from_residual(residual: Result<Infallible, E>) -> Self
fn from_residual(residual: Result<Infallible, E>) -> Self
🔬This is a nightly-only experimental API. (
try_trait_v2)Constructs the type from a compatible
Residual type. Read moresource§impl<T, E> FromResidual<Yeet<E>> for NdResult<T, E>
impl<T, E> FromResidual<Yeet<E>> for NdResult<T, E>
source§fn from_residual(residual: Yeet<E>) -> Self
fn from_residual(residual: Yeet<E>) -> Self
🔬This is a nightly-only experimental API. (
try_trait_v2)Constructs the type from a compatible
Residual type. Read moresource§impl<T, E> MonadicReturn for NdResult<T, E>
impl<T, E> MonadicReturn for NdResult<T, E>
source§fn monadic_return(t: T) -> Self
fn monadic_return(t: T) -> Self
Wraps a value of
Self::Inner into a Self.source§impl<T, E> Residual<T> for NdResult<Infallible, E>
impl<T, E> Residual<T> for NdResult<Infallible, E>
source§impl<T, E> Try for NdResult<T, E>
impl<T, E> Try for NdResult<T, E>
§type Output = T
type Output = T
🔬This is a nightly-only experimental API. (
try_trait_v2)The type of the value produced by
? when not short-circuiting.§type Residual = NdResult<Infallible, E>
type Residual = NdResult<Infallible, E>
🔬This is a nightly-only experimental API. (
try_trait_v2)The type of the value passed to
FromResidual::from_residual
as part of ? when short-circuiting. Read moresource§fn from_output(output: Self::Output) -> Self
fn from_output(output: Self::Output) -> Self
🔬This is a nightly-only experimental API. (
try_trait_v2)Constructs the type from its
Output type. Read moresource§fn branch(self) -> ControlFlow<Self::Residual, Self::Output>
fn branch(self) -> ControlFlow<Self::Residual, Self::Output>
🔬This is a nightly-only experimental API. (
try_trait_v2)Used in
? to decide whether the operator should produce a value
(because this returned ControlFlow::Continue)
or propagate a value back to the caller
(because this returned ControlFlow::Break). Read moreAuto Trait Implementations§
impl<T, E> Freeze for NdResult<T, E>
impl<T, E> RefUnwindSafe for NdResult<T, E>where
T: RefUnwindSafe,
E: RefUnwindSafe,
impl<T, E> Send for NdResult<T, E>
impl<T, E> Sync for NdResult<T, E>
impl<T, E> Unpin for NdResult<T, E>
impl<T, E> UnwindSafe for NdResult<T, E>where
T: UnwindSafe,
E: UnwindSafe,
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