pub struct Response {
pub status: StatusCode,
pub headers: Headers,
pub body: Body,
pub message: Option<String>,
}
Expand description
Represents a HTTP response.
Fields§
§status: StatusCode
§headers: Headers
§body: Body
§message: Option<String>
Implementations§
Source§impl Response
impl Response
pub fn new(body: impl Into<Body>) -> Self
pub fn with_status(self, status: impl Into<StatusCode>) -> Self
pub fn with_headers(self, headers: Headers) -> Self
pub fn with_message(self, message: impl Into<String>) -> Self
pub fn status(&self) -> &StatusCode
pub fn headers(&self) -> &Headers
pub fn body(&self) -> &Body
pub fn message(&self) -> Option<&str>
pub fn is_ok(&self) -> bool
pub fn is_error(&self) -> bool
Trait Implementations§
impl StructuralPartialEq for Response
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