pub struct ResponseHead {
pub version: Version,
pub status: StatusCode,
pub headers: HeaderMap,
pub reason: Option<&'static str>,
/* private fields */
}Fields§
§version: Version§status: StatusCode§headers: HeaderMap§reason: Option<&'static str>Implementations§
Source§impl ResponseHead
impl ResponseHead
Sourcepub fn new(status: StatusCode) -> ResponseHead
pub fn new(status: StatusCode) -> ResponseHead
Create new instance of ResponseHead type
Sourcepub fn extensions(&self) -> Ref<'_, Extensions>
pub fn extensions(&self) -> Ref<'_, Extensions>
Message extensions
Sourcepub fn extensions_mut(&self) -> RefMut<'_, Extensions>
pub fn extensions_mut(&self) -> RefMut<'_, Extensions>
Mutable reference to a the message’s extensions
Sourcepub fn headers_mut(&mut self) -> &mut HeaderMap
pub fn headers_mut(&mut self) -> &mut HeaderMap
Mutable reference to the message headers.
Sourcepub fn set_connection_type(&mut self, ctype: ConnectionType)
pub fn set_connection_type(&mut self, ctype: ConnectionType)
Set connection type of the message
pub fn connection_type(&self) -> ConnectionType
Sourcepub fn keep_alive(&self) -> bool
pub fn keep_alive(&self) -> bool
Check if keep-alive is enabled
Sourcepub fn no_chunking(&mut self, val: bool)
pub fn no_chunking(&mut self, val: bool)
Set no chunking for payload
Trait Implementations§
Source§impl Debug for ResponseHead
impl Debug for ResponseHead
Source§impl<'a> From<&'a ResponseHead> for ResponseBuilder
Convert ResponseHead to a ResponseBuilder
impl<'a> From<&'a ResponseHead> for ResponseBuilder
Convert ResponseHead to a ResponseBuilder
Source§fn from(head: &'a ResponseHead) -> ResponseBuilder ⓘ
fn from(head: &'a ResponseHead) -> ResponseBuilder ⓘ
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for ResponseHead
impl !RefUnwindSafe for ResponseHead
impl !Send for ResponseHead
impl !Sync for ResponseHead
impl Unpin for ResponseHead
impl !UnwindSafe for ResponseHead
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more