pub struct Action<H: Handler> { /* private fields */ }Expand description
An Action<H> can be handled by a Handler using Action::handle_with. Actions
can be created with the action! macro. Any Handler automatically implements
HandleMessage<Action<H>>. Any Action<H> implements Protocol and
Message automatically.
(See handler for an overview)
Implementations§
Trait Implementations§
Source§impl<H: Handler> FromPayload<Action<H>> for Action<H>
impl<H: Handler> FromPayload<Action<H>> for Action<H>
Source§fn from_payload(payload: Self) -> Selfwhere
Self: Sized,
fn from_payload(payload: Self) -> Selfwhere
Self: Sized,
Create the
Protocol from the Message::Payload.Source§fn try_into_payload(self) -> Result<Self, Self>where
Self: Sized,
fn try_into_payload(self) -> Result<Self, Self>where
Self: Sized,
Attempt to convert the protocol into the
Message::Payload of M.Source§impl<H: Handler> HandleMessage<Action<H>> for H
impl<H: Handler> HandleMessage<Action<H>> for H
Source§impl<H: Handler> HandledBy<H> for Action<H>
impl<H: Handler> HandledBy<H> for Action<H>
fn handle_with<'life0, 'life1, 'async_trait>(
self,
handler: &'life0 mut H,
state: &'life1 mut <H as Handler>::State,
) -> Pin<Box<dyn Future<Output = HandlerResult<H>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl<H: Handler> Message for Action<H>
impl<H: Handler> Message for Action<H>
Source§impl<H: Handler> Protocol for Action<H>
impl<H: Handler> Protocol for Action<H>
Source§fn into_boxed_payload(self) -> BoxPayload
fn into_boxed_payload(self) -> BoxPayload
Take out the payload as a
BoxPayload.Source§fn try_from_boxed_payload(payload: BoxPayload) -> Result<Self, BoxPayload>where
Self: Sized,
fn try_from_boxed_payload(payload: BoxPayload) -> Result<Self, BoxPayload>where
Self: Sized,
Auto Trait Implementations§
impl<H> Freeze for Action<H>
impl<H> !RefUnwindSafe for Action<H>
impl<H> Send for Action<H>
impl<H> !Sync for Action<H>
impl<H> Unpin for Action<H>
impl<H> !UnwindSafe for Action<H>
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