Skip to main content

ResponseCodeTrait

Trait ResponseCodeTrait 

Source
pub trait ResponseCodeTrait {
    // Required methods
    fn code(&self) -> i64;
    fn message(&self) -> &'static str;
}
Available on crate feature response only.
Expand description

Business code and message carried by a Response.

Implemented by the enums generated by generate_response, or by hand.

Required Methods§

Source

fn code(&self) -> i64

Business code in the response body.

Source

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

Message in the response body (an i18n key when the i18n feature is enabled).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§