pub struct Redirect { /* private fields */ }Available on crate feature
server only.Expand description
Response with 3XX Status Code and specified Location
Implementations§
Source§impl Redirect
impl Redirect
Sourcepub fn with_status_code(status: StatusCode, location: &str) -> Self
pub fn with_status_code(status: StatusCode, location: &str) -> Self
Sourcepub fn moved_permanently(location: &str) -> Self
pub fn moved_permanently(location: &str) -> Self
Create a new Redirect with 301 Moved Permanently status code.
§Panics
If the location is not a valid header value.
Sourcepub fn temporary_redirect(location: &str) -> Self
pub fn temporary_redirect(location: &str) -> Self
Create a new Redirect with 307 Temporary Redirect status code.
§Panics
If the location is not a valid header value.
Sourcepub fn permanent_redirect(location: &str) -> Self
pub fn permanent_redirect(location: &str) -> Self
Create a new Redirect with 308 Permanent Redirect status code.
§Panics
If the location is not a valid header value.
Trait Implementations§
Source§impl IntoResponse for Redirect
impl IntoResponse for Redirect
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Consume self and convert it into a
ResponseAuto Trait Implementations§
impl !Freeze for Redirect
impl RefUnwindSafe for Redirect
impl Send for Redirect
impl Sync for Redirect
impl Unpin 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