ErrorContext

Trait ErrorContext 

Source
pub trait ErrorContext<T> {
    // Required methods
    fn with_rule_context(self, rule_id: &str) -> Result<T>;
    fn with_document_context(self, path: &str) -> Result<T>;
    fn with_plugin_context(self, plugin_id: &str) -> Result<T>;
    fn with_config_context(self, field: &str) -> Result<T>;
}
Expand description

Error context extension trait for adding contextual information to errors

Required Methods§

Source

fn with_rule_context(self, rule_id: &str) -> Result<T>

Add rule context to an error

Source

fn with_document_context(self, path: &str) -> Result<T>

Add document context to an error

Source

fn with_plugin_context(self, plugin_id: &str) -> Result<T>

Add plugin context to an error

Source

fn with_config_context(self, field: &str) -> Result<T>

Add configuration context to an error

Implementations on Foreign Types§

Source§

impl<T> ErrorContext<T> for Result<T, MdBookLintError>

Source§

fn with_rule_context(self, rule_id: &str) -> Result<T>

Source§

fn with_document_context(self, path: &str) -> Result<T>

Source§

fn with_plugin_context(self, plugin_id: &str) -> Result<T>

Source§

fn with_config_context(self, field: &str) -> Result<T>

Implementors§