Struct gotham_restful::Redirect
source · pub struct Redirect {
pub to: String,
}
Expand description
This is the return type of a resource that only returns a redirect. It will result in a 303 See Other answer, meaning the redirect will always result in a GET request on the target.
#[read_all]
fn read_all() -> Redirect {
Redirect {
to: "http://localhost:8080/cool/new/location".to_owned()
}
}
Fields§
§to: String
Trait Implementations§
source§impl IntoResponse for Redirect
impl IntoResponse for Redirect
type Err = InvalidHeaderValue
source§impl ResponseSchema for Redirect
impl ResponseSchema for Redirect
source§fn status_codes() -> Vec<StatusCode>
fn status_codes() -> Vec<StatusCode>
All status codes returned by this response. Returns
[StatusCode::OK]
by default.source§fn schema(code: StatusCode) -> OpenapiSchema
fn schema(code: StatusCode) -> OpenapiSchema
Return the schema of the response for the given status code. The code may
only be one that was previously returned by Self::status_codes. The
implementation should panic if that is not the case.
Auto Trait Implementations§
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more