pub struct ResponseHeaders { /* private fields */ }
Expand description
Wrapper over the list of headers associated with a HTTP Response.
When creating a ResponseHeaders object, the content type is initialized to text/plain
.
The content type can be updated with a call to set_content_type
.
Implementations§
Source§impl ResponseHeaders
impl ResponseHeaders
Sourcepub fn write_all<T: Write>(&self, buf: &mut T) -> Result<(), WriteError>
pub fn write_all<T: Write>(&self, buf: &mut T) -> Result<(), WriteError>
Writes the headers to buf
using the HTTP specification.
Sourcepub fn set_server(&mut self, server: &str)
pub fn set_server(&mut self, server: &str)
Sets the HTTP response header server.
Sourcepub fn set_content_type(&mut self, content_type: MediaType)
pub fn set_content_type(&mut self, content_type: MediaType)
Sets the content type to be written in the HTTP response.
Sourcepub fn set_deprecation(&mut self)
pub fn set_deprecation(&mut self)
Sets the Deprecation
header to be written in the HTTP response.
https://tools.ietf.org/id/draft-dalal-deprecation-header-03.html
Sourcepub fn set_encoding(&mut self)
pub fn set_encoding(&mut self)
Sets the encoding type to be written in the HTTP response.
Trait Implementations§
Source§impl Debug for ResponseHeaders
impl Debug for ResponseHeaders
Source§impl Default for ResponseHeaders
impl Default for ResponseHeaders
Source§impl PartialEq for ResponseHeaders
impl PartialEq for ResponseHeaders
impl Eq for ResponseHeaders
impl StructuralPartialEq for ResponseHeaders
Auto Trait Implementations§
impl Freeze for ResponseHeaders
impl RefUnwindSafe for ResponseHeaders
impl Send for ResponseHeaders
impl Sync for ResponseHeaders
impl Unpin for ResponseHeaders
impl UnwindSafe for ResponseHeaders
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