Trait vortex_error::VortexExpect

source ·
pub trait VortexExpect {
    type Output;

    // Required method
    fn vortex_expect(self, msg: &str) -> Self::Output;
}
Expand description

A trait for expect-ing a VortexResult or an Option.

Required Associated Types§

source

type Output

The type of the value being expected.

Required Methods§

source

fn vortex_expect(self, msg: &str) -> Self::Output

Returns the value of the result if it is Ok, otherwise panics with the error. Should be called only in contexts where the error condition represents a bug (programmer error).

Implementations on Foreign Types§

source§

impl<T> VortexExpect for Option<T>

source§

type Output = T

source§

fn vortex_expect(self, msg: &str) -> Self::Output

source§

impl<T, E> VortexExpect for Result<T, E>
where E: Into<VortexError>,

source§

type Output = T

source§

fn vortex_expect(self, msg: &str) -> Self::Output

Implementors§