pub struct HttpResponse { /* private fields */ }Expand description
Concrete implementation of IHttpResponse.
Implementations§
Source§impl HttpResponse
impl HttpResponse
pub fn new(status: u16) -> HttpResponse
Trait Implementations§
Source§impl IHttpResponse for HttpResponse
impl IHttpResponse for HttpResponse
fn set_status(&mut self, code: u16)
fn set_header(&mut self, key: &str, value: &str)
Source§fn remove_header(&mut self, key: &str)
fn remove_header(&mut self, key: &str)
Remove a response header by name. Default is a no-op.
Source§fn write_bytes<'life0, 'async_trait>(
&'life0 mut self,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
HttpResponse: 'async_trait,
fn write_bytes<'life0, 'async_trait>(
&'life0 mut self,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
HttpResponse: 'async_trait,
Write raw bytes as the response body.
Source§fn write_text<'life0, 'life1, 'async_trait>(
&'life0 mut self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
HttpResponse: 'async_trait,
fn write_text<'life0, 'life1, 'async_trait>(
&'life0 mut self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
HttpResponse: 'async_trait,
Write a UTF-8 string as the response body.
Source§fn write_body<'life0, 'async_trait>(
&'life0 mut self,
body: ResponseBody,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
HttpResponse: 'async_trait,
fn write_body<'life0, 'async_trait>(
&'life0 mut self,
body: ResponseBody,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
HttpResponse: 'async_trait,
Replace the response body with a structured
ResponseBody. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for HttpResponse
impl !Sync for HttpResponse
impl !UnwindSafe for HttpResponse
impl Forget for HttpResponse
impl Freeze for HttpResponse
impl Move for HttpResponse
impl Send for HttpResponse
impl Unpin for HttpResponse
impl UnsafeUnpin for HttpResponse
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