pub struct HttpResponse { /* private fields */ }
Implementations§
Source§impl HttpResponse
impl HttpResponse
Sourcepub fn insert_header(&mut self, key: String, value: String)
pub fn insert_header(&mut self, key: String, value: String)
Insert a pair key - value to response headers (if key is already existed, replace the old value of key)
Sourcepub fn body_string(&self) -> Result<String, FromUtf8Error>
pub fn body_string(&self) -> Result<String, FromUtf8Error>
Retrieve the response body as string
pub fn bytes(&mut self, b: Vec<u8>)
Sourcepub fn status(&self) -> &HttpStatusStruct
pub fn status(&self) -> &HttpStatusStruct
Retrieve the response status
Sourcepub fn set_status(&mut self, status: HttpStatusStruct)
pub fn set_status(&mut self, status: HttpStatusStruct)
Set the response status
Auto Trait Implementations§
impl Freeze for HttpResponse
impl RefUnwindSafe for HttpResponse
impl Send for HttpResponse
impl Sync for HttpResponse
impl Unpin for HttpResponse
impl UnwindSafe 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