pub struct IncomingFlashMessages { /* private fields */ }
Expand description
An actix-web
extractor to retrieve FlashMessage
s attached to an incoming request.
use actix_web::{Responder, HttpResponse, get};
use actix_web_flash_messages::IncomingFlashMessages;
#[get("/show")]
async fn show(messages: IncomingFlashMessages) -> impl Responder {
for message in messages.iter() {
println!("{} - {}", message.content(), message.level());
}
HttpResponse::Ok()
}
This method will panic if FlashMessagesFramework
has not been registered as a middleware.
Implementations
sourceimpl IncomingFlashMessages
impl IncomingFlashMessages
sourcepub fn iter(&self) -> impl ExactSizeIterator<Item = &FlashMessage>
pub fn iter(&self) -> impl ExactSizeIterator<Item = &FlashMessage>
Return an iterator over incoming FlashMessage
s.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for IncomingFlashMessages
impl<'de> Deserialize<'de> for IncomingFlashMessages
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl FromRequest for IncomingFlashMessages
impl FromRequest for IncomingFlashMessages
type Future = Ready<Result<IncomingFlashMessages, <IncomingFlashMessages as FromRequest>::Error>>
type Future = Ready<Result<IncomingFlashMessages, <IncomingFlashMessages as FromRequest>::Error>>
Future that resolves to a Self
. Read more
sourcefn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future
fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future
Create a Self
from request parts asynchronously.
sourcefn extract(req: &HttpRequest) -> Self::Future
fn extract(req: &HttpRequest) -> Self::Future
Create a Self
from request head asynchronously. Read more
sourceimpl Serialize for IncomingFlashMessages
impl Serialize for IncomingFlashMessages
Auto Trait Implementations
impl RefUnwindSafe for IncomingFlashMessages
impl Send for IncomingFlashMessages
impl Sync for IncomingFlashMessages
impl Unpin for IncomingFlashMessages
impl UnwindSafe for IncomingFlashMessages
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more