ErrorInfo

Trait ErrorInfo 

Source
pub trait ErrorInfo {
    // Required methods
    fn status(&self) -> StatusCode;
    fn code(&self) -> &'static str;
    fn raw_message(&self) -> &'static str;
    fn fields(&self) -> HashMap<String, String>;

    // Provided method
    fn message(&self) -> String { ... }
}
Expand description

Trait containing common information for an error

Required Methods§

Source

fn status(&self) -> StatusCode

Retrieves the status of the error message

Source

fn code(&self) -> &'static str

Retrieves the code of the error message

Source

fn raw_message(&self) -> &'static str

Retrieves the raw message of the error, without variable replacements

Source

fn fields(&self) -> HashMap<String, String>

Retrieves the error fields used on the message

Provided Methods§

Source

fn message(&self) -> String

Builds the final error message with the variable fields interpolated

Implementors§