Trait FromResidual
trait FromResidual<R = <Self as Try>::Residual>
Used to specify which residuals can be converted into which crate::ops::Try types.
Every Try type needs to be recreatable from its own associated
Residual type, but can also have additional FromResidual implementations
to support interconversion with other Try types.
Required Methods
fn from_residual(residual: R) -> SelfConstructs the type from a compatible
Residualtype.This should be implemented consistently with the
branchmethod such that applying the?operator will get back an equivalent residual:FromResidual::from_residual(r).branch() --> ControlFlow::Break(r). (The residual is not mandated to be identical when interconversion is involved.)Examples
use ; assert_eq!; assert_eq!; assert_eq!;
Implementors
impl<T, E, F: From<E>> FromResidual for Poll<Result<T, F>>impl<T, E, F: From<E>> FromResidual for Poll<Option<Result<T, F>>>impl<T> FromResidual for Option<T>impl<T> FromResidual for Option<T>impl<T, E, F: ~const From<E>> FromResidual for Result<T, F>impl<B, C> FromResidual for ControlFlow<B, C>impl<T, E, F: ~const From<E>> FromResidual for Result<T, F>