pub struct HttpHeaders<'a> {
pub raw: &'a mut http,
}Expand description
HTTP headers of an object, wrapping HTTP from Varnish
Fields§
§raw: &'a mut httpImplementations§
Source§impl<'a> HttpHeaders<'a>
impl<'a> HttpHeaders<'a>
Sourcepub fn set_header(&mut self, name: &str, value: &str) -> VclResult<()>
pub fn set_header(&mut self, name: &str, value: &str) -> VclResult<()>
Append a new header using name and value. This can fail if we run out of internal slots
to store the new header
pub fn unset_header(&mut self, name: &str)
Sourcepub fn proto(&self) -> Option<&str>
pub fn proto(&self) -> Option<&str>
Protocol of an object
It should exist for both requests and responses, but the Option is maintained for
consistency.
Sourcepub fn set_status(&mut self, status: u16)
pub fn set_status(&mut self, status: u16)
Set the response status, it will also set the reason
Sourcepub fn set_reason(&mut self, value: &str) -> VclResult<()>
pub fn set_reason(&mut self, value: &str) -> VclResult<()>
Set reason
Sourcepub fn header(&self, name: &str) -> Option<&str>
pub fn header(&self, name: &str) -> Option<&str>
Returns the value of a header based on its name
The header names are compared in a case-insensitive manner
pub fn iter(&self) -> HttpHeadersIter<'_> ⓘ
Trait Implementations§
Source§impl<'a> Debug for HttpHeaders<'a>
impl<'a> Debug for HttpHeaders<'a>
Source§impl<'a> IntoIterator for &'a HttpHeaders<'a>
impl<'a> IntoIterator for &'a HttpHeaders<'a>
Auto Trait Implementations§
impl<'a> Freeze for HttpHeaders<'a>
impl<'a> RefUnwindSafe for HttpHeaders<'a>
impl<'a> !Send for HttpHeaders<'a>
impl<'a> !Sync for HttpHeaders<'a>
impl<'a> Unpin for HttpHeaders<'a>
impl<'a> !UnwindSafe for HttpHeaders<'a>
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