pub struct Response {
pub status: Status,
pub location: Option<Url>,
pub www_authenticate: Option<String>,
pub body: Option<Body>,
}Expand description
Open and simple implementation of WebResponse.
Fields§
§status: StatusHTTP status code.
location: Option<Url>A location header, for example for redirects.
www_authenticate: Option<String>Indicates how the client should have authenticated.
Only set with Unauthorized status.
body: Option<Body>Encoded body of the response.
One variant for each possible encoding type.
Trait Implementations§
source§impl WebResponse for Response
impl WebResponse for Response
source§fn redirect(&mut self, url: Url) -> Result<(), Self::Error>
fn redirect(&mut self, url: Url) -> Result<(), Self::Error>
A response which will redirect the user-agent to which the response is issued.
Set the response status to 401 and add a WWW-Authenticate header.
source§fn body_text(&mut self, text: &str) -> Result<(), Self::Error>
fn body_text(&mut self, text: &str) -> Result<(), Self::Error>
A pure text response with no special media type set.
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