Skip to main content

ContextSource

Trait ContextSource 

Source
pub trait ContextSource {
    // Required method
    fn apply(&self, err: GeopError) -> GeopError;
}
Expand description

Something that can turn one GeopError into another, more-annotated one — either a plain message (wrapped via GeopError::with_context) or a callback that builds the wrapped error itself (e.g. to embed live state captured at the call site). Lets WithContext::with_context accept either .with_context("a message") or .with_context(&|e| ...).

Required Methods§

Source

fn apply(&self, err: GeopError) -> GeopError

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ContextSource for String

Source§

fn apply(&self, err: GeopError) -> GeopError

Source§

impl ContextSource for str

Source§

fn apply(&self, err: GeopError) -> GeopError

Implementors§