Skip to main content

SgResponseExt

Trait SgResponseExt 

Source
pub trait SgResponseExt {
    // Required methods
    fn with_code_message(code: StatusCode, message: impl Into<Bytes>) -> Self;
    fn with_code_empty(code: StatusCode) -> Self;
    fn inherit_reflect(&mut self, req: &SgRequest);

    // Provided method
    fn bad_gateway<E: Error>(e: E) -> Self
       where Self: Sized { ... }
}
Expand description

Provides extension methods for Response.

Required Methods§

Source

fn with_code_message(code: StatusCode, message: impl Into<Bytes>) -> Self

Source

fn with_code_empty(code: StatusCode) -> Self

Source

fn inherit_reflect(&mut self, req: &SgRequest)

Provided Methods§

Source

fn bad_gateway<E: Error>(e: E) -> Self
where Self: Sized,

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 SgResponseExt for Response<SgBody>

Source§

fn with_code_message(code: StatusCode, message: impl Into<Bytes>) -> Self

Source§

fn with_code_empty(code: StatusCode) -> Self

Source§

fn inherit_reflect(&mut self, req: &SgRequest)

Implementors§