pub struct Response {
pub status: Status,
pub headers: HeaderMap,
pub body: Vec<u8>,
}Expand description
HTTP response
Fields§
§status: StatusStatus
headers: HeaderMapHeaders
body: Vec<u8>Body
Implementations§
Source§impl Response
impl Response
Sourcepub fn with_status(status: Status) -> Self
pub fn with_status(status: Status) -> Self
Create new response with status
Sourcepub fn with_header(name: impl Into<String>, value: impl Into<String>) -> Self
pub fn with_header(name: impl Into<String>, value: impl Into<String>) -> Self
Create new response with header
Sourcepub fn with_redirect(location: impl Into<String>) -> Self
pub fn with_redirect(location: impl Into<String>) -> Self
Create new response with redirect header
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