Represents a successful result (Ok<T>), encapsulating a valid value.
Ok<T>
The type of the successful value.
Constructs an Ok<T> instance with a successful value.
The valid value to wrap.
Maps the contained value to another Result<U, never>, allowing chaining.
Result<U, never>
The transformed success type.
The function returning a Result<U, never>.
Executes the ifOk function with the contained value.
ifOk
The return type.
(Unused) Function for Err<E>.
Err<E>
Function to apply to the value.
ifOk(value)
Checks if this is an Err<E>, meaning it contains an error.
false
Checks if this is an Ok<T>, meaning it contains a valid value.
true
Transforms the contained value using a function.
The return type after transformation.
The function to apply.
Ok<U>
Maps the error, but since this is Ok<T>, it remains unchanged.
The new error type.
Unused error mapping function.
Returns the current Ok<T>, ignoring the provided alternative.
(Unused) An alternative Result<T>.
Result<T>
Retrieves the contained value, ignoring the provided default.
(Unused) A fallback value.
Retrieves the contained value, or throws an error if it is Err<E>.
Never throws, as this is always Ok<T>.
Static
Creates an error (Err<E>) result.
The error to wrap.
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 successful result (
Ok<T>
), encapsulating a valid value.