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§
Sourcefn status_code(&self) -> u32
fn status_code(&self) -> u32
Returns the status code from a Response.
Sourcefn header(&self, name: &str) -> Option<String>
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.
Sourcefn headers(&self) -> Vec<(String, String)>
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.