Maps a Result<T, E> to Result<U, E | F> by applying a function to a contained Ok value, producing a new result.
Maps a Result<T, E> to Promise<Result<U, E | F>> by applying a function to a contained Ok value, producing a new async result.
The error, if available.
Allows inspection of the interior result value, if it is Ok. May be useful in cases where you do not want to modify the result.
Allows inspection of the interior error value, if it is Err. May be useful in cases where you do not want to modify the error.
Asserts that the current result is Err and the error passes the given predicate.
Asserts that the current result is Ok and the value passes the given predicate.
Maps a Result<T, E> to Result<U, E> by applying a function to a contained Ok value, leaving the Err value untouched.
Maps a Result<T, E> to Promise<Result<U, E>> by applying a function to a contained Ok value, leaving the Err value untouched.
Maps a Result<T, E> to Result<T, F> by applying a function to a contained Err value, leaving the Ok value untouched.
Maps a Result<T, E> to U by applying a function to a contained Ok value. If the result is an Err, the fallback value will be returned.
Maps a Result<T, E> to Promise by applying a function to a contained Ok value. If the result is an Err, the fallback value will be returned.
Maps a Result<T, E> to U by applying a function to a contained Ok value. If the result is an Err, the fallback function will be called and its result will be returned.
Maps a Result<T, E> to Promise by applying a function to a contained Ok value. If the result is an Err, the fallback function will be called and its result will be returned.
Returns the passed value if this is Err, otherwise returns this.
Calls fn if the result is an Err, otherwise returns this.
Returns a string representation of the result for debugging purposes.
Returns the inner value of a result, if it is Ok. Otherwise, the contained error will be thrown.
USE THIS SPARINGLY! It is generally better to use unwrapOr or map to
handle situations you may be temped to .unwrap() in.
Returns the inner value of a result, if it is Ok. Otherwise, the provided fallback value will be returned.
Returns the inner value of a result, if it is Ok. Otherwise, the provided fallback funtion will be called and its result will be returned.
The good value, if available.
Unwraps a result, yielding the value.
USE THIS SPARINGLY! It is generally better to use unwrapOr or map to
handle situations you may be temped to .expect() in.
This is good for using in tests.
Unwraps a result, yielding the error.
USE THIS SPARINGLY! It is generally better to use unwrapOr or map to
handle situations you may be temped to .expect() in.
This is good for using in tests.
Returns the passed value if this is Ok, otherwise returns this.