Extractors<T, E> extension

Extract value or error

on

Methods

expect(String message) → T
Returns the contained ok (success) value.
expectErr(String message) → E
Returns the contained err (failure) value.
unwrap() → T
Returns the contained ok (success) value. Because this function may throw an exception, its use is generally discouraged. Instead, prefer to use switch statements with the Result.type and handle the err (failure) case explicitly, or call `unwrapOr`, `unwrapOrElse`.
unwrapErr() → E
Returns the contained err (failure) value.
unwrapOr(T fallback) → T
Returns the contained ok (success) value or a provided fallback.
unwrapOrElse(T fallback(E error)) → T
Returns the contained ok (success) value or computes it from the closure.