Struct hyper::server::response::Response [-]  [+] [src]

pub struct Response<'a, W = Fresh> {
    pub version: HttpVersion,
    // some fields omitted
}

The outgoing half for a Tcp connection, created by a Server and given to a Handler.

Fields

version

The HTTP version of this response.

Methods

impl<'a, W> Response<'a, W>

fn status(&self) -> StatusCode

The status of this response.

fn headers(&self) -> &Headers

The headers of this response.

fn construct(version: HttpVersion, body: HttpWriter<&'a mut Writer + 'a>, status: StatusCode, headers: Headers) -> Response<'a, Fresh>

Construct a Response from its constituent parts.

fn deconstruct(self) -> (HttpVersion, HttpWriter<&'a mut Writer + 'a>, StatusCode, Headers)

Deconstruct this Response into its constituent parts.

impl<'a> Response<'a, Fresh>

fn new(stream: &'a mut Writer + 'a) -> Response<'a, Fresh>

Creates a new Response that can be used to write to a network stream.

fn start(self) -> IoResult<Response<'a, Streaming>>

Consume this Response, writing the Headers and Status and creating a Response

fn status_mut(&mut self) -> &mut StatusCode

Get a mutable reference to the status.

fn headers_mut(&mut self) -> &mut Headers

Get a mutable reference to the Headers.

impl<'a> Response<'a, Streaming>

fn end(self) -> IoResult<()>

Flushes all writing of a response to the client.

Trait Implementations

impl<'a> Writer for Response<'a, Streaming>

fn write(&mut self, msg: &[u8]) -> IoResult<()>

fn flush(&mut self) -> IoResult<()>

fn write_fmt(&mut self, fmt: Arguments) -> Result<(), IoError>

fn write_str(&mut self, s: &str) -> Result<(), IoError>

fn write_line(&mut self, s: &str) -> Result<(), IoError>

fn write_char(&mut self, c: char) -> Result<(), IoError>

fn write_int(&mut self, n: isize) -> Result<(), IoError>

fn write_uint(&mut self, n: usize) -> Result<(), IoError>

fn write_le_uint(&mut self, n: usize) -> Result<(), IoError>

fn write_le_int(&mut self, n: isize) -> Result<(), IoError>

fn write_be_uint(&mut self, n: usize) -> Result<(), IoError>

fn write_be_int(&mut self, n: isize) -> Result<(), IoError>

fn write_be_u64(&mut self, n: u64) -> Result<(), IoError>

fn write_be_u32(&mut self, n: u32) -> Result<(), IoError>

fn write_be_u16(&mut self, n: u16) -> Result<(), IoError>

fn write_be_i64(&mut self, n: i64) -> Result<(), IoError>

fn write_be_i32(&mut self, n: i32) -> Result<(), IoError>

fn write_be_i16(&mut self, n: i16) -> Result<(), IoError>

fn write_be_f64(&mut self, f: f64) -> Result<(), IoError>

fn write_be_f32(&mut self, f: f32) -> Result<(), IoError>

fn write_le_u64(&mut self, n: u64) -> Result<(), IoError>

fn write_le_u32(&mut self, n: u32) -> Result<(), IoError>

fn write_le_u16(&mut self, n: u16) -> Result<(), IoError>

fn write_le_i64(&mut self, n: i64) -> Result<(), IoError>

fn write_le_i32(&mut self, n: i32) -> Result<(), IoError>

fn write_le_i16(&mut self, n: i16) -> Result<(), IoError>

fn write_le_f64(&mut self, f: f64) -> Result<(), IoError>

fn write_le_f32(&mut self, f: f32) -> Result<(), IoError>

fn write_u8(&mut self, n: u8) -> Result<(), IoError>

fn write_i8(&mut self, n: i8) -> Result<(), IoError>