Trait HttpResponseData

Source
pub trait HttpResponseData {
    // Required methods
    fn protocol(&mut self, value: Protocol) -> ServerResponse;
    fn status(&mut self, value: HttpStatus) -> ServerResponse;
    fn body(&mut self, value: &[u8]) -> ServerResponse;
    fn headers(&mut self, value: Headers) -> ServerResponse;
    fn header(&mut self, k: &str, v: &str) -> ServerResponse;
}
Expand description

Basic Operations for HttpResponse

Required Methods§

Source

fn protocol(&mut self, value: Protocol) -> ServerResponse

Set response protocol

§Errors
  • wrapper for expected return type
Source

fn status(&mut self, value: HttpStatus) -> ServerResponse

Set response status

§Errors
  • wrapper for expected return type
Source

fn body(&mut self, value: &[u8]) -> ServerResponse

Set response body

§Errors
  • wrapper for expected return type
Source

fn headers(&mut self, value: Headers) -> ServerResponse

Set response headers

§Errors
  • wrapper for expected return type
Source

fn header(&mut self, k: &str, v: &str) -> ServerResponse

Append response headers

§Errors
  • wrapper for expected return type

Implementors§