Skip to main content

MapExpect

Trait MapExpect 

Source
pub trait MapExpect<'a, T> {
    // Required method
    fn map_expect(self, msg: &'a str) -> T;
}

Required Methods§

Source

fn map_expect(self, msg: &'a str) -> T

Calls expect(msg) on the mapped Result value. This is similar to map(Result::unwrap) but composes an expect call and message without requiring a closure.

Implementations on Foreign Types§

Source§

impl<'a, T, E: Debug> MapExpect<'a, Option<T>> for Option<Result<T, E>>

Source§

fn map_expect(self, msg: &'a str) -> Option<T>

Implementors§

Source§

impl<'a, T, E: Debug> MapExpect<'a, Result<T, E>> for Result<Option<T>, E>