pub struct Sender<T: Message> {
pub actor_id: ActorId,
/* private fields */
}
Expand description
Sender of a specific message type
Like Caller<T>
, Sender has a weak reference to the recipient of the message type,
and so will not prevent an actor from stopping if all Addr
’s have been dropped elsewhere.
This allows it to be used in the send_later
and send_interval
actor functions,
and not keep the actor alive indefinitely even after all references to it have been dropped (unless ctx.stop()
is called from within)
Fields§
§actor_id: ActorId
Id of the corresponding Actor<A>
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Sender<T>
impl<T> !RefUnwindSafe for Sender<T>
impl<T> Send for Sender<T>
impl<T> Sync for Sender<T>
impl<T> Unpin for Sender<T>
impl<T> !UnwindSafe for Sender<T>
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