[−][src]Struct httpbis::Headers
HTTP message headers (or trailers)
Implementations
impl Headers
[src]
pub fn new() -> Headers
[src]
Construct empty headers
pub fn from_vec(headers: Vec<Header>) -> Headers
[src]
Construct headers from a vec of individual headers
pub fn iter(&self) -> impl Iterator<Item = &Header>
[src]
Return an iterator over headers.
Pseudo headers returned first.
pub fn dump(&self) -> String
[src]
Dump all headers as multiline string.
pub fn new_get(path: impl Into<HeaderValue>) -> Headers
[src]
Construct a Headers
object with specified :method
and :path
headers
pub fn new_post(path: impl Into<HeaderValue>) -> Headers
[src]
Construct a Headers
object with specified :method
and :path
headers
pub fn new_status(code: u32) -> Headers
[src]
Construct a Headers
object with single :status
header
pub fn ok_200() -> Headers
[src]
Construct :status 200
headers
pub fn not_found_404() -> Headers
[src]
Construct :status 404
headers
pub fn internal_error_500() -> Headers
[src]
Construct :status 500
headers
pub fn redirect_302(location: impl Into<HeaderValue>) -> Headers
[src]
Construct :status 302; location: <location>
headers
pub fn get_opt<'a>(&'a self, name: &str) -> Option<&'a str>
[src]
Lookup header.
pub fn get<'a>(&'a self, name: &str) -> &'a str
[src]
pub fn get_opt_parse<I: FromStr>(&self, name: &str) -> Option<I>
[src]
Lookup header.
pub fn status(&self) -> u32
[src]
Status header value.
pub fn path(&self) -> &str
[src]
Path header.
pub fn method(&self) -> &str
[src]
Method header.
pub fn content_length(&self) -> Option<u64>
[src]
Content-length header.
pub fn add(
&mut self,
name: impl Into<HeaderName>,
value: impl Into<HeaderValue>
)
[src]
&mut self,
name: impl Into<HeaderName>,
value: impl Into<HeaderValue>
)
Add a header
pub fn add_header(&mut self, header: Header)
[src]
Add a header
pub fn extend(&mut self, headers: Headers)
[src]
Add all headers
Trait Implementations
impl Clone for Headers
[src]
impl Debug for Headers
[src]
impl Default for Headers
[src]
impl Eq for Headers
[src]
impl FromIterator<Header> for Headers
[src]
fn from_iter<T: IntoIterator<Item = Header>>(iter: T) -> Headers
[src]
impl PartialEq<Headers> for Headers
[src]
impl StructuralEq for Headers
[src]
impl StructuralPartialEq for Headers
[src]
Auto Trait Implementations
impl RefUnwindSafe for Headers
impl Send for Headers
impl Sync for Headers
impl Unpin for Headers
impl UnwindSafe for Headers
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,