Construct a ~Maybe Maybe from a ~Result Result<T, E>.
~Maybe Maybe
~Result Result<T, E>
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 Nothing.
Result
Ok
Just
Err
E
~Nothing Nothing
The type of the value wrapped in a Result.Ok and in the Just of the resulting Maybe.
Result.Ok
Maybe
The Result to construct a Maybe from.
Just if result was Ok or Nothing if it was Err.
result
Nothing
Construct a
~Maybe Maybe
from a~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 Nothing
.