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

pub trait Context: Any {
    pub fn operation(&self) -> &'static str;
pub fn has_expected(&self) -> bool;
pub fn expected(&self, w: &mut dyn Write) -> Result;
pub fn as_any(&self) -> &dyn Any; }

The base context surrounding an error.

Required methods

pub fn operation(&self) -> &'static str[src]

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>.

pub fn has_expected(&self) -> bool[src]

Returns true if there is an expected value.

pub fn expected(&self, w: &mut dyn Write) -> Result[src]

The expected value.

Errors

Returns a fmt::Error if failed to write to the formatter.

pub fn as_any(&self) -> &dyn Any[src]

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...