pub trait VortexExpect {
type Output;
// Required method
fn vortex_expect(self, msg: &'static str) -> Self::Output;
}Expand description
A trait for expect-ing a VortexResult or an Option.
Required Associated Types§
Required Methods§
Sourcefn vortex_expect(self, msg: &'static str) -> Self::Output
fn vortex_expect(self, msg: &'static 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).
§&'static message lifetime
The panic string argument should be a string literal, hence the &'static lifetime. If
you’d like to panic with a dynamic format string, consider using unwrap_or_else combined
with the vortex_panic! macro instead.