pub struct HttpHeaders { /* private fields */ }
Implementations§
Source§impl HttpHeaders
impl HttpHeaders
Sourcepub fn from_vec(header_lines: &Vec<String>) -> Self
pub fn from_vec(header_lines: &Vec<String>) -> Self
Parse lines from HTTP response into struct.
pub fn has(&self, key: &str) -> bool
pub fn has_lower(&self, key: &str) -> bool
Sourcepub fn get(&self, key: &str) -> Option<String>
pub fn get(&self, key: &str) -> Option<String>
Get value of HTTP header. Case-sensitive, will only return first instance if multiple instances of same key exist.
Sourcepub fn get_lower(&self, key: &str) -> Option<String>
pub fn get_lower(&self, key: &str) -> Option<String>
Get value of HTTP header. Same as get(), but case-insensitive.
Sourcepub fn get_vec(&self, key: &str) -> Vec<String>
pub fn get_vec(&self, key: &str) -> Vec<String>
Get vector of all values of header, case-sensitive.
pub fn get_lower_vec(&self, key: &str) -> Vec<String>
Sourcepub fn get_line(&self, key: &str) -> Option<String>
pub fn get_line(&self, key: &str) -> Option<String>
Get header line, all values delimited by “;”, case-sensitive.
Sourcepub fn get_lower_line(&self, key: &str) -> Option<String>
pub fn get_lower_line(&self, key: &str) -> Option<String>
Get header line, all values delimited by “;”, case-sensitive.
Sourcepub fn set(&mut self, key: &str, value: &str)
pub fn set(&mut self, key: &str, value: &str)
Set header, replacing any existing header value with same key
Sourcepub fn set_vec(&mut self, key: &str, value: &Vec<&str>)
pub fn set_vec(&mut self, key: &str, value: &Vec<&str>)
Set header, replacing any existing header value with same key
Trait Implementations§
Source§impl Clone for HttpHeaders
impl Clone for HttpHeaders
Source§fn clone(&self) -> HttpHeaders
fn clone(&self) -> HttpHeaders
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for HttpHeaders
impl RefUnwindSafe for HttpHeaders
impl Send for HttpHeaders
impl Sync for HttpHeaders
impl Unpin for HttpHeaders
impl UnwindSafe for HttpHeaders
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more