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

pub struct Response<W> {
    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<W> Response<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<BufferedWriter<Box<NetworkStream + Send>>>, status: StatusCode, headers: Headers) -> Response<Fresh>

Construct a Response from its constituent parts.

impl Response<Fresh>

fn new<S: NetworkStream>(stream: S) -> Response<Fresh>

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

fn start(self) -> IoResult<Response<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.

fn deconstruct(self) -> (HttpVersion, HttpWriter<BufferedWriter<Box<NetworkStream + Send>>>, StatusCode, Headers)

Deconstruct this Response into its constituent parts.

impl Response<Streaming>

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

Flushes all writing of a response to the client.

Trait Implementations

impl Writer for Response<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: int) -> Result<(), IoError>

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

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

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

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

fn write_be_int(&mut self, n: int) -> 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>

fn by_ref(&'a mut self) -> RefWriter<'a, Self>