[][src]Trait unwrap_infallible::UnwrapInfallible

pub trait UnwrapInfallible {
    type Ok;
    fn unwrap_infallible(self) -> Self::Ok;
}

Unwrapping an infallible result into its success value.

Associated Types

type Ok

Type of the Ok variant of the result.

Loading content...

Required methods

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.

Loading content...

Implementations on Foreign Types

impl<T> UnwrapInfallible for Result<T, Infallible>[src]

type Ok = T

Loading content...

Implementors

Loading content...