ResponseBuffers

Trait ResponseBuffers 

Source
pub trait ResponseBuffers {
    // Required methods
    fn status_code(&self) -> u32;
    fn header(&self, name: &str) -> Option<String>;
    fn headers(&self) -> Vec<(String, String)>;
    fn body(&self, start: usize, max_size: usize) -> Option<Bytes>;
    fn trailers(&self) -> Vec<(String, String)>;
}
Expand description

An accessor for response parts.

Required Methods§

Source

fn status_code(&self) -> u32

Returns the status code from a Response.

Source

fn header(&self, name: &str) -> Option<String>

Returns a header value by name if exists. Known Limitations: The header value will be converted to an utf-8 String If the bytes correspond to a non utf-8 string they will be parsed as an iso_8859_1 encoding.

Source

fn headers(&self) -> Vec<(String, String)>

Returns a Vec containing all pairs of header names and their values. Known Limitations: The header values will be converted to utf-8 Strings If the bytes correspond to a non utf-8 string they will be parsed as an iso_8859_1 encoding.

Source

fn body(&self, start: usize, max_size: usize) -> Option<Bytes>

Returns the body in binary format.

Source

fn trailers(&self) -> Vec<(String, String)>

Returns a Vec containing all pairs of trailer names and their values.

Implementations on Foreign Types§

Source§

impl ResponseBuffers for Rc<dyn Host>

Source§

fn status_code(&self) -> u32

Source§

fn header(&self, name: &str) -> Option<String>

Source§

fn headers(&self) -> Vec<(String, String)>

Source§

fn body(&self, start: usize, max_size: usize) -> Option<Bytes>

Source§

fn trailers(&self) -> Vec<(String, String)>

Implementors§