[−][src]Trait emacs::ResultExt
Emacs-specific extension methods for Result
.
Required methods
unsafe fn unwrap_or_propagate(self) -> T
Deprecated since 0.12.0:
Use Result or a variable to track error instead
Unwraps a result, yielding the content of an Ok
.
Panics
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.
Safety
The panic must not propagate across an FFI boundary, e.g. this must not be used in callbacks
that will be called by C code. See Rust's issue #52652
.