Trait explicit::ResultExt

source ·
pub trait ResultExt<T, E> {
    // Required method
    fn ok_checked<EE: EqType<E>>(self) -> Option<T>;
}
Expand description

An extension trait adding functionality to Result.

Required Methods§

source

fn ok_checked<EE: EqType<E>>(self) -> Option<T>

Like Result::ok, but the caller must provide the error type being discarded.

This allows code to be written which will stop compiling if a result’s error type changes in the future.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T, E> ResultExt<T, E> for Result<T, E>

source§

fn ok_checked<EE: EqType<E>>(self) -> Option<T>

Implementors§