Get the wrapped value from a Result
or Option
object
unwrap.Rd
If the provided object is a Failure
(in the case of a Result
input) or
Nothing
(in the case of an Option
input), then the function will 'panic'
and throw an error of class unwrap_fail_panic
.
For this reason, use of this function is not generally advised unless you specifically want to crash your R program or throw an error condition.
Instead you are encouraged to handle the "unhappy path" yourself using
unwrap_or_default
or unwrap_or_else
.
See also
Prefer unwrap_or_default()
or unwrap_or_else()
to explicitly handle the unhappy path.
Alternatively, use unwrap_option()
to change a Success
to a Some
and a Failure
to a Nothing
.