pub struct Headers { /* private fields */ }Implementations§
source§impl Headers
impl Headers
pub fn from_entries(entries: Vec<(String, String)>) -> Self
sourcepub fn from(entries: Vec<(&str, &str)>) -> Self
pub fn from(entries: Vec<(&str, &str)>) -> Self
Examples found in repository?
examples/simple_site.rs (line 17)
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
fn ok_response(&mut self, content: String) -> HttpResponse {
HttpResponse::from_string(
Headers::from(vec![("Content-Type", "text/html")]),
"200 OK".to_string(),
content,
)
}
fn not_found_response(&mut self, content: String) -> HttpResponse {
HttpResponse::from_string(
Headers::from(vec![("Content-Type", "text/html")]),
"404 Not Found".to_string(),
content,
)
}pub fn new() -> Self
pub fn contains_value(self, value: String) -> bool
pub fn contains_key(self, key: String) -> bool
pub fn get(self, key: String) -> Option<String>
pub fn put(&mut self, key: String, value: String)
pub fn remove(&mut self, key: String)
pub fn keys(self) -> Vec<String>
pub fn values(self) -> Vec<String>
pub fn entries(self) -> Vec<(String, String)>
pub fn len(self) -> usize
pub fn clear(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Headers
impl RefUnwindSafe for Headers
impl Send for Headers
impl Sync for Headers
impl Unpin for Headers
impl UnwindSafe for Headers
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