Extracts the successful value from an Ok result, or returns a default value if it's an Err.
Ok
Err
The type of the successful value.
The type of the error value.
The result from which to unwrap the value.
The default value to return if the result is an Err.
The successful value if result is Ok, otherwise with_default.
result
with_default
Extracts the successful value from an
Ok
result, or returns a default value if it's anErr
.