[][src]Trait dangerous::error::Context

pub trait Context: Any + Debug {
    fn operation(&self) -> &'static str;
fn expected(&self) -> Option<&dyn Display>;
fn as_any(&self) -> &dyn Any; }

The base context surrounding an error.

Required methods

fn operation(&self) -> &'static str

The operation that was attempted when an error occurred.

It should described in a simple manner what is trying to be achieved and make sense in the following sentence if you were to substitute it:

error attempting to <operation>.

fn expected(&self) -> Option<&dyn Display>

Returns a fmt::Display formattable value of what was expected.

fn as_any(&self) -> &dyn Any

Return a reference of self as Any.

Loading content...

Implementations on Foreign Types

impl Context for &'static str[src]

Loading content...

Implementors

impl Context for ExpectedContext[src]

Loading content...