Skip to main content

ResponseCodeContract

Trait ResponseCodeContract 

Source
pub trait ResponseCodeContract: Clone {
    // Required methods
    fn code(&self) -> Cow<'static, str>;
    fn status(&self) -> StatusCode;
    fn from_code(code: &str) -> Self;
    fn from_status(status: StatusCode) -> Self;

    // Provided method
    fn success(&self) -> bool { ... }
}

Required Methods§

Source

fn code(&self) -> Cow<'static, str>

Source

fn status(&self) -> StatusCode

Source

fn from_code(code: &str) -> Self

Source

fn from_status(status: StatusCode) -> Self

Provided Methods§

Source

fn success(&self) -> bool

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§