pub struct Response<R, T>{ /* private fields */ }Expand description
The “flashing” response
Implementations§
Source§impl<T> Response<HttpResponse, T>where
T: Serialize + DeserializeOwned,
impl<T> Response<HttpResponse, T>where
T: Serialize + DeserializeOwned,
Sourcepub fn with_redirect(message: T, location: &str) -> Self
pub fn with_redirect(message: T, location: &str) -> Self
Create a new flashing response with given message and redirect location.
Trait Implementations§
Source§impl<R, T> Responder for Response<R, T>
impl<R, T> Responder for Response<R, T>
Source§type Future = Pin<Box<dyn Future<Output = Result<Response, <Response<R, T> as Responder>::Error>>>>
type Future = Pin<Box<dyn Future<Output = Result<Response, <Response<R, T> as Responder>::Error>>>>
The future response value.
Source§fn respond_to(self, req: &HttpRequest) -> Self::Future
fn respond_to(self, req: &HttpRequest) -> Self::Future
Convert itself to
AsyncResult or Error.Source§fn with_status(self, status: StatusCode) -> CustomResponder<Self>where
Self: Sized,
fn with_status(self, status: StatusCode) -> CustomResponder<Self>where
Self: Sized,
Override a status code for a Responder. Read more
Source§fn with_header<K, V>(self, key: K, value: V) -> CustomResponder<Self>where
Self: Sized,
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Into<Error>,
V: IntoHeaderValue,
fn with_header<K, V>(self, key: K, value: V) -> CustomResponder<Self>where
Self: Sized,
HeaderName: TryFrom<K>,
<HeaderName as TryFrom<K>>::Error: Into<Error>,
V: IntoHeaderValue,
Add header to the Responder’s response. Read more
Auto Trait Implementations§
impl<R, T> Freeze for Response<R, T>
impl<R, T> RefUnwindSafe for Response<R, T>where
R: RefUnwindSafe,
T: RefUnwindSafe,
impl<R, T> Send for Response<R, T>
impl<R, T> Sync for Response<R, T>
impl<R, T> Unpin for Response<R, T>
impl<R, T> UnwindSafe for Response<R, T>where
R: UnwindSafe,
T: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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