pub struct HTTP<'a> {
pub raw: &'a mut http,
}
Expand description
HTTP headers of an object
Fields§
§raw: &'a mut http
Implementations§
source§impl<'a> HTTP<'a>
impl<'a> HTTP<'a>
sourcepub fn set_header(&mut self, name: &str, value: &str) -> Result<()>
pub fn set_header(&mut self, name: &str, value: &str) -> Result<()>
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) -> Result<()>
pub fn set_reason(&mut self, value: &str) -> Result<()>
Set reason
Trait Implementations§
source§impl<'a> IntoIterator for &'a HTTP<'a>
impl<'a> IntoIterator for &'a HTTP<'a>
Auto Trait Implementations§
impl<'a> Freeze for HTTP<'a>
impl<'a> RefUnwindSafe for HTTP<'a>
impl<'a> !Send for HTTP<'a>
impl<'a> !Sync for HTTP<'a>
impl<'a> Unpin for HTTP<'a>
impl<'a> !UnwindSafe for HTTP<'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