Enum byte_fmt::eval::ApplyResult
source · pub enum ApplyResult<V = Vec<u8, Global>> {
NoValue,
Value(V),
Err(Error),
}
Expand description
Utility that impl’s try for both None and Err Semantically the None value means the caller has to decide whether to continue.
Variants§
Implementations§
source§impl<V> ApplyResult<V>
impl<V> ApplyResult<V>
pub fn map<X>(self, f: impl FnOnce(V) -> X) -> ApplyResult<X>
pub fn into_ok(self) -> Result<Option<V>, Error>
pub fn into_opt(self) -> Option<Result<V, Error>>
pub fn arg_err<X>( args: impl IntoIterator<Item = X>, expect: &str ) -> ApplyResult<V>where X: AsRef<[u8]>,
pub fn or_else(self, map: impl FnOnce() -> ApplyResult<V>) -> ApplyResult<V>
pub fn require(self, msg: &'static str) -> ApplyResult<V>
pub fn context<C>(self, context: C) -> ApplyResult<V>where C: Display + Send + Sync + 'static,
Trait Implementations§
source§impl<V> Debug for ApplyResult<V>where
V: Debug,
impl<V> Debug for ApplyResult<V>where V: Debug,
source§impl<V> From<Option<V>> for ApplyResult<V>
impl<V> From<Option<V>> for ApplyResult<V>
source§fn from(value: Option<V>) -> ApplyResult<V>
fn from(value: Option<V>) -> ApplyResult<V>
Converts to this type from the input type.
source§impl<V> From<V> for ApplyResult<V>
impl<V> From<V> for ApplyResult<V>
source§fn from(value: V) -> ApplyResult<V>
fn from(value: V) -> ApplyResult<V>
Converts to this type from the input type.
source§impl<V> FromResidual<ApplyResult<V>> for ApplyResult<V>
impl<V> FromResidual<ApplyResult<V>> for ApplyResult<V>
source§fn from_residual(residual: ApplyResult<V>) -> ApplyResult<V>
fn from_residual(residual: ApplyResult<V>) -> ApplyResult<V>
🔬This is a nightly-only experimental API. (
try_trait_v2
)Constructs the type from a compatible
Residual
type. Read moresource§impl<V> FromResidual<Option<Infallible>> for ApplyResult<V>
impl<V> FromResidual<Option<Infallible>> for ApplyResult<V>
source§fn from_residual(_residual: Option<Infallible>) -> ApplyResult<V>
fn from_residual(_residual: Option<Infallible>) -> ApplyResult<V>
🔬This is a nightly-only experimental API. (
try_trait_v2
)Constructs the type from a compatible
Residual
type. Read moresource§impl<V, E> FromResidual<Result<Infallible, E>> for ApplyResult<V>where
E: Into<Error>,
impl<V, E> FromResidual<Result<Infallible, E>> for ApplyResult<V>where E: Into<Error>,
source§fn from_residual(residual: Result<Infallible, E>) -> ApplyResult<V>
fn from_residual(residual: Result<Infallible, E>) -> ApplyResult<V>
🔬This is a nightly-only experimental API. (
try_trait_v2
)Constructs the type from a compatible
Residual
type. Read moresource§impl<V> Try for ApplyResult<V>
impl<V> Try for ApplyResult<V>
§type Output = V
type Output = V
🔬This is a nightly-only experimental API. (
try_trait_v2
)The type of the value produced by
?
when not short-circuiting.§type Residual = ApplyResult<V>
type Residual = ApplyResult<V>
🔬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: <ApplyResult<V> as Try>::Output) -> ApplyResult<V>
fn from_output(output: <ApplyResult<V> as Try>::Output) -> ApplyResult<V>
🔬This is a nightly-only experimental API. (
try_trait_v2
)Constructs the type from its
Output
type. Read moresource§fn branch(
self
) -> ControlFlow<<ApplyResult<V> as Try>::Residual, <ApplyResult<V> as Try>::Output>
fn branch( self ) -> ControlFlow<<ApplyResult<V> as Try>::Residual, <ApplyResult<V> as Try>::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 more