Construct a Maybe from a Result.Result Result<T, E>.
Maybe
If the Result is an Ok, wrap its value in Just. If the Result is an Err, throw away the wrapped E and transform to a Nothing.
Result
Ok
Just
Err
E
The Result to construct a Maybe from.
Just if result was Ok or Nothing if it was Err.
result
Nothing
T The type of the value wrapped in a Result.Ok and in the Just of the resulting Maybe.
Result.Ok
Generated using TypeDoc
Construct a
Maybe
from a Result.Result Result<T, E>.If the
Result
is anOk
, wrap its value inJust
. If theResult
is anErr
, throw away the wrappedE
and transform to a Nothing.