pub struct Response { /* private fields */ }Expand description
A tiny response wrapper (status, headers, body).
Implementations§
Source§impl Response
impl Response
pub fn from_data(data: impl Into<Bytes>) -> Self
pub fn from_string(s: impl Into<String>) -> Self
pub fn from_status_and_string(code: u16, s: impl Into<String>) -> Self
pub fn empty(status: u16) -> Self
pub fn with_status_code(self, code: u16) -> Self
pub fn with_header(self, header: Header) -> Self
pub fn with_content_type(self, value: &str) -> Self
Sourcepub fn status_code(&self) -> u16
pub fn status_code(&self) -> u16
Returns the HTTP status code of the response.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
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