Represents a failure result (Err<E>), encapsulating an error.
Err<E>
The type of the error.
Constructs an Err<E> instance with an error value.
The error to wrap.
Maps the contained value to another Result<U, E>, allowing chaining.
Result<U, E>
The transformed success type.
Unused transformation function.
Executes the ifErr function with the contained error.
ifErr
The return type.
Function applied to the error.
(Unused) Function for Ok<T>.
Ok<T>
ifErr(error)
Checks if this is an Err<E>, meaning it contains an error.
true
Checks if this is an Ok<T>, meaning it contains a valid value.
false
Maps the successful value, but since this is Err<E>, it remains unchanged.
Maps the error to another error type.
The transformed error type.
The function to transform the error.
Err<F>
Returns the provided alternative Result<T, E> since Err<E> contains nothing.
Result<T, E>
The success type.
The alternative Result<T, E>.
Retrieves the provided default value since Err<E> contains nothing.
The fallback value.
Throws the contained error.
Static
Creates an error (Err<E>) result.
An Err instance containing the error.
Err
Creates a success (Ok<T>) result.
The value to wrap.
An Ok instance containing the value.
Ok
Represents a failure result (
Err<E>
), encapsulating an error.