ErrorHandler

Trait ErrorHandler 

Source
pub trait ErrorHandler {
    // Required methods
    fn map_err<T, E>(&self, res: Result<T, E>) -> Result<T, HostError>
       where Error: From<E>,
             E: Debug;
    fn error(&self, error: Error, msg: &str, args: &[Val]) -> HostError;
}
Expand description

This is a trait for mapping Results carrying various error types into HostError, while potentially recording the existence of the error to diagnostic logs.

Required Methods§

Source

fn map_err<T, E>(&self, res: Result<T, E>) -> Result<T, HostError>
where Error: From<E>, E: Debug,

Source

fn error(&self, error: Error, msg: &str, args: &[Val]) -> HostError

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.

Implementors§