pub struct Redirect { /* private fields */ }Expand description
A validated HTTP redirect response.
Implementations§
Source§impl Redirect
impl Redirect
Sourcepub fn to(
location: impl TryInto<HeaderValue>,
) -> Result<Redirect, InvalidHeader>
pub fn to( location: impl TryInto<HeaderValue>, ) -> Result<Redirect, InvalidHeader>
Create a 302 Found redirect.
§Errors
Returns InvalidHeader when the location contains invalid header bytes.
Sourcepub fn see_other(
location: impl TryInto<HeaderValue>,
) -> Result<Redirect, InvalidHeader>
pub fn see_other( location: impl TryInto<HeaderValue>, ) -> Result<Redirect, InvalidHeader>
Create a 303 See Other redirect, suitable after a form submission.
§Errors
Returns InvalidHeader when the location contains invalid header bytes.
Sourcepub fn temporary(
location: impl TryInto<HeaderValue>,
) -> Result<Redirect, InvalidHeader>
pub fn temporary( location: impl TryInto<HeaderValue>, ) -> Result<Redirect, InvalidHeader>
Create a 307 Temporary Redirect response.
§Errors
Returns InvalidHeader when the location contains invalid header bytes.
Trait Implementations§
Source§impl IntoResponse for Redirect
impl IntoResponse for Redirect
fn into_response(self) -> Response
Auto Trait Implementations§
impl !Freeze for Redirect
impl RefUnwindSafe for Redirect
impl Send for Redirect
impl Sync for Redirect
impl Unpin for Redirect
impl UnsafeUnpin for Redirect
impl UnwindSafe for Redirect
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