Trait WithErrorCode

Source
pub trait WithErrorCode<E> {
    // Required method
    fn with_code(self, code: impl Into<String>) -> CodedError<E>;
}
Expand description

Extension trait for adding error codes

Required Methods§

Source

fn with_code(self, code: impl Into<String>) -> CodedError<E>

Attach an error code to an error

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<E> WithErrorCode<E> for E