Struct dbs_uhttp::ResponseHeaders
source · [−]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
sourceimpl 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
sourceimpl Debug for ResponseHeaders
impl Debug for ResponseHeaders
sourceimpl Default for ResponseHeaders
impl Default for ResponseHeaders
sourceimpl PartialEq<ResponseHeaders> for ResponseHeaders
impl PartialEq<ResponseHeaders> for ResponseHeaders
sourcefn eq(&self, other: &ResponseHeaders) -> bool
fn eq(&self, other: &ResponseHeaders) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
impl Eq for ResponseHeaders
impl StructuralEq for ResponseHeaders
impl StructuralPartialEq for ResponseHeaders
Auto Trait Implementations
impl RefUnwindSafe for ResponseHeaders
impl Send for ResponseHeaders
impl Sync for ResponseHeaders
impl Unpin for ResponseHeaders
impl UnwindSafe for ResponseHeaders
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more