Trait ResultExt

Source
pub trait ResultExt<T, E> {
    // Required method
    fn or_signal<'e, S>(self, env: &'e Env, symbol: S) -> Result<T>
       where S: IntoLispSymbol<'e>;
}
Expand description

Emacs-specific extension methods for the standard library’s Result.

Required Methods§

Source

fn or_signal<'e, S>(self, env: &'e Env, symbol: S) -> Result<T>
where S: IntoLispSymbol<'e>,

Converts the error into a Lisp signal if this result is an Err. The first element of the associated signal data will be a string formatted with Display::fmt.

If the result is an Ok, it is returned unchanged.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

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

Source§

fn or_signal<'e, S>(self, env: &'e Env, symbol: S) -> Result<T>
where S: IntoLispSymbol<'e>,

Implementors§