Response

Trait Response 

Source
pub trait Response: 'static + Send {
    // Required methods
    fn from_result<T: Serialize, C: Debug + Copy + Sync + Send + 'static + Into<u16>>(
        ret: Result<T, C>,
    ) -> Self;
    fn new(status: StatusCode) -> Self;
    fn insert_header(&mut self, name: HeaderName, value: HeaderValue);
    fn set_content_type(&mut self, content_type: &str) -> HttpResult<()>;
    fn set_body(&mut self, body: Vec<u8>);
    fn set_body_read<R: AsyncRead + Send + Unpin + 'static>(
        &mut self,
        reader: R,
    );
}

Required Methods§

Source

fn from_result<T: Serialize, C: Debug + Copy + Sync + Send + 'static + Into<u16>>( ret: Result<T, C>, ) -> Self

Source

fn new(status: StatusCode) -> Self

Source

fn insert_header(&mut self, name: HeaderName, value: HeaderValue)

Source

fn set_content_type(&mut self, content_type: &str) -> HttpResult<()>

Source

fn set_body(&mut self, body: Vec<u8>)

Source

fn set_body_read<R: AsyncRead + Send + Unpin + 'static>(&mut self, reader: R)

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§