[][src]Trait emacs::ResultExt

pub trait ResultExt<T, E> {
    fn unwrap_or_propagate(self) -> T;

Emacs-specific extension methods for Result.

Required methods

fn unwrap_or_propagate(self) -> T

Unwraps a result, yielding the content of an Ok.


Panics if the value is an Err, using a sensible panic value.

If the underlying error is an ErrorKind, it will be used as the value of the panic, which makes the #[defun] behave as if the corresponding non-local exit was propagated. Otherwise, tries to use Display to get a descriptive error message.

This is useful when errors cannot be propagated using Result, e.g. callbacks whose types are dictated by 3rd-party libraries.

Loading content...


impl<T> ResultExt<T, Error> for Result<T>[src]

Loading content...