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: &Request<SgBody>);

    // Provided method
    fn bad_gateway<E>(e: E) -> Self
       where E: Error,
             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: &Request<SgBody>)

Provided Methods§

Source

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

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.

Implementations on Foreign Types§

Source§

impl SgResponseExt for Response<SgBody>

Implementors§