Struct tonari_actor::Recipient
source · [−]pub struct Recipient<M> { /* private fields */ }Expand description
Similar to Addr, but rather than pointing to a specific actor,
it is typed for any actor that handles a given message-response type.
Implementations
sourceimpl<M: 'static> Recipient<M>
impl<M: 'static> Recipient<M>
sourcepub fn recipient<N: Into<M>>(&self) -> Recipient<N>
pub fn recipient<N: Into<M>>(&self) -> Recipient<N>
Convert a Recipient<M> (or Addr<A> through Deref, where A::Message = M) into
Recipient<N>, where message N can be converted into M.
In case of converting from Addr, this erases the type of the actor and only preserves
type of the message, allowing you to make actors more independent of each other.
Trait Implementations
sourceimpl<M> RecipientExt<M> for Recipient<TimedMessage<M>>
impl<M> RecipientExt<M> for Recipient<TimedMessage<M>>
sourcefn send_now(&self, message: M) -> Result<(), SendError>
fn send_now(&self, message: M) -> Result<(), SendError>
Send a message now. Convenience to wrap message in TimedMessage::Instant.
sourcefn send_timed(&self, message: M, fire_at: Instant) -> Result<(), SendError>
fn send_timed(&self, message: M, fire_at: Instant) -> Result<(), SendError>
Send a message to be delivered later at a certain instant.
Auto Trait Implementations
impl<M> !RefUnwindSafe for Recipient<M>
impl<M> Send for Recipient<M>
impl<M> Sync for Recipient<M>
impl<M> Unpin for Recipient<M>
impl<M> !UnwindSafe for Recipient<M>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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