Struct async_web_server::HttpResponse
source · [−]pub struct HttpResponse<IO: AsyncRead + AsyncWrite + Unpin> { /* private fields */ }
Implementations
sourceimpl<IO: AsyncRead + AsyncWrite + Unpin> HttpResponse<IO>
impl<IO: AsyncRead + AsyncWrite + Unpin> HttpResponse<IO>
sourcepub fn request_headers(&self) -> &HeaderMap
pub fn request_headers(&self) -> &HeaderMap
Access the original requests headers as http::HeaderMap.
sourcepub fn method(&self) -> Method
pub fn method(&self) -> Method
Return the original requests method as http::Method.
sourcepub fn version(&self) -> Version
pub fn version(&self) -> Version
Return the HTTP version as http::Version.
sourcepub fn headers(&self) -> &HeaderMap
pub fn headers(&self) -> &HeaderMap
Access the currently set response headers as http::HeaderMap.
sourcepub fn headers_mut(&mut self) -> &mut HeaderMap
pub fn headers_mut(&mut self) -> &mut HeaderMap
Access the currently set response headers as mutable http::HeaderMap.
sourcepub fn insert_header(
&mut self,
key: impl IntoHeaderName,
value: HeaderValue
) -> &mut Self
pub fn insert_header(
&mut self,
key: impl IntoHeaderName,
value: HeaderValue
) -> &mut Self
Insert a response header (chainable).
sourcepub fn status(&self) -> StatusCode
pub fn status(&self) -> StatusCode
Access the currently set response status as http::StatusCode.
sourcepub fn status_mut(&mut self) -> &mut StatusCode
pub fn status_mut(&mut self) -> &mut StatusCode
Access the currently set response status as mutable http::StatusCode.
sourcepub fn set_status(&mut self, status: StatusCode) -> &mut Self
pub fn set_status(&mut self, status: StatusCode) -> &mut Self
Set the response status (chainable).
Auto Trait Implementations
impl<IO> RefUnwindSafe for HttpResponse<IO> where
IO: RefUnwindSafe,
impl<IO> Send for HttpResponse<IO> where
IO: Send,
impl<IO> Sync for HttpResponse<IO> where
IO: Sync,
impl<IO> Unpin for HttpResponse<IO>
impl<IO> UnwindSafe for HttpResponse<IO> where
IO: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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