[][src]Struct libsip::ResponseGenerator

pub struct ResponseGenerator { /* fields omitted */ }

Sip Response Generator. When build is called the struct is consumed and produces a SipMessage::Response variant. Calling the code method before the build method is required.

Implementations

impl ResponseGenerator[src]

pub fn new() -> ResponseGenerator[src]

Get a new instance of the ResponseGenerator.

pub fn code(self, code: u32) -> ResponseGenerator[src]

Set the response status code.

pub fn headers(self, headers: Vec<Header>) -> ResponseGenerator[src]

Add multiple headers to the response header list. This use's Vec::extend so that the current items in the header list are kept.

pub fn header(self, header: Header) -> ResponseGenerator[src]

Add a single header to the response header list.

pub fn header_ref(&self) -> &Headers[src]

Get a reference to the header list.

pub fn headers_ref_mut(&mut self) -> &mut Headers[src]

Get a mutable reference to the header list.

pub fn body(self, body: Vec<u8>) -> ResponseGenerator[src]

Set the sip response body. This completely replaces the current response body.

pub fn build(self) -> IoResult<SipMessage>[src]

Create the Sip response.

Trait Implementations

impl Default for ResponseGenerator[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,