Struct vl53l1::outcome::Outcome

source ·
pub struct Outcome<T> {
    pub warning: Option<Warning>,
    /* private fields */
}
Expand description

An alternative to the Ok variant of Result that allows for handling warnings.

Fields§

§warning: Option<Warning>

Implementations§

Create a new Outcome instance.

An outcome with no warning.

An outcome with a warning.

Map the outcome to a new type with the given function.

Returns Ok if the warning was in the set of warnings to be ignored, otherwise returns the Warning as an Err.

Ignore warnings if any were emitted and return the value.

Return an error in the case that a warning was produced.

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.