Skip to main content

ResultExt

Trait ResultExt 

Source
pub trait ResultExt<T> {
    // Required methods
    fn or_throw_msg(self, ctx: &Ctx<'_>, msg: &str) -> Result<T>;
    fn or_throw_range(self, ctx: &Ctx<'_>, msg: &str) -> Result<T>;
    fn or_throw_type(self, ctx: &Ctx<'_>, msg: &str) -> Result<T>;
    fn or_throw(self, ctx: &Ctx<'_>) -> Result<T>;
}

Required Methods§

Source

fn or_throw_msg(self, ctx: &Ctx<'_>, msg: &str) -> Result<T>

Source

fn or_throw_range(self, ctx: &Ctx<'_>, msg: &str) -> Result<T>

Source

fn or_throw_type(self, ctx: &Ctx<'_>, msg: &str) -> Result<T>

Source

fn or_throw(self, ctx: &Ctx<'_>) -> Result<T>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

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

Source§

fn or_throw_msg(self, ctx: &Ctx<'_>, msg: &str) -> Result<T>

Source§

fn or_throw_range(self, ctx: &Ctx<'_>, msg: &str) -> Result<T>

Source§

fn or_throw_type(self, ctx: &Ctx<'_>, msg: &str) -> Result<T>

Source§

fn or_throw(self, ctx: &Ctx<'_>) -> Result<T>

Source§

impl<T> ResultExt<T> for Option<T>

Source§

fn or_throw_msg(self, ctx: &Ctx<'_>, msg: &str) -> Result<T>

Source§

fn or_throw_range(self, ctx: &Ctx<'_>, msg: &str) -> Result<T>

Source§

fn or_throw_type(self, ctx: &Ctx<'_>, msg: &str) -> Result<T>

Source§

fn or_throw(self, ctx: &Ctx<'_>) -> Result<T>

Implementors§