pub struct Response { /* private fields */ }Expand description
An HTTP Response to be returned by Request filters.
Implementations§
Source§impl Response
impl Response
Sourcepub fn with_headers(self, headers: impl Into<Vec<(String, String)>>) -> Self
pub fn with_headers(self, headers: impl Into<Vec<(String, String)>>) -> Self
Consumes the current Response and returns a new one with a list of headers setted.
Sourcepub fn with_body(self, body: impl Into<Vec<u8>>) -> Self
pub fn with_body(self, body: impl Into<Vec<u8>>) -> Self
Consumes the current Response and returns a new one with a body setted.
Sourcepub fn status_code(&self) -> u32
pub fn status_code(&self) -> u32
Returns the status code.
Trait Implementations§
Source§impl Ord for Response
impl Ord for Response
Source§impl PartialOrd for Response
impl PartialOrd for Response
impl Eq for Response
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