Skip to main content

_unwrap_infallible_UnwrapInfallible

Trait _unwrap_infallible_UnwrapInfallible 

Source
pub trait _unwrap_infallible_UnwrapInfallible {
    type Ok;

    // Required method
    fn unwrap_infallible(self) -> Self::Ok;
}
Expand description

Unwrapping an infallible result into its success value.

Required Associated Types§

Source

type Ok

Type of the Ok variant of the result.

Required Methods§

Source

fn unwrap_infallible(self) -> Self::Ok

Unwraps a result, returning the content of an Ok.

Unlike Result::unwrap, this method is known to never panic on the result types it is implemented for. Therefore, it can be used instead of unwrap as a maintainability safeguard that will fail to compile if the error type of the Result is later changed to an error that can actually occur.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> UnwrapInfallible for Result<T, !>

Available on non-crate feature blanket_impl only.

Implementors§