1.1.0
A wrapper that warps a value of type T, that can either be a value or some, or none
Get access to the underling value
T
Safely unwrap an option, with a default value
(T)
The value to be used in the case that the option is None, if this is expensive, please use unwrapOrElse for lazy computation
T
Safely unwrap an option, with a function that returns the default value
(function (): T)
A function to be called incas of None
T
A wrapper that represents either a value of type T or an error of type E
Create a function that can wrap any other function that returns T
in a Result<T, E>
Wrap a function so that it returns a Result<T, E> instead of throwing an error. If you only want to specify E, use createFnWrapper to generate a function wrapper first
(function (...args: Args): T)
the function you want to wrap
function (...args: Args): Result<T, E>
Unwrap the underling result.
T
Attempt to get the underling value, but if there is an error, return the default value. If this computation is expensive, use unwrapOrElse for lazy evaluation instead
(T)
The default value to use incas of an error
T
Attempt to get the underling value, but if there is an error, return the error
(function (error: E): T)
The function to call to get the value, error is the default value
T