Skip to main content

Config

Trait Config 

Source
pub trait Config {
    type Id;

    const CODE: Option<&'static str> = None;

    // Provided methods
    fn id() -> Option<Self::Id> { ... }
    fn display<C: Config, D>(gerr: &GErr<C, D>) -> String
       where C::Id: Display,
             D: Debug { ... }
}
Expand description

Error config.

Provided Associated Constants§

Source

const CODE: Option<&'static str> = None

Error code.

Required Associated Types§

Source

type Id

Error id.

§Must be:
  • Implementing Display & Debug.
  • Implementing serde’s Serialize and Deserialize for serde feature.

Provided Methods§

Source

fn id() -> Option<Self::Id>

Auto-generate error id.

Source

fn display<C: Config, D>(gerr: &GErr<C, D>) -> String
where C::Id: Display, D: Debug,

Display error message.

It will be invoked in Display implementation.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Config for ()

Implementors§