pub struct ActorEntityHandle<M> { /* private fields */ }Expand description
Typed ingress and lifecycle controls for a spawned ActorEntity.
Self::from_actor_ref adapts a Ractor actor whose mailbox message may
wrap the sharded message. This lets actor behaviors keep private runtime
protocol messages while exposing only M at the sharding boundary.
Implementations§
Source§impl<M> ActorEntityHandle<M>where
M: Send + 'static,
impl<M> ActorEntityHandle<M>where
M: Send + 'static,
Sourcepub fn from_actor_ref<A, F>(actor: ActorRef<A>, make_message: F) -> Self
pub fn from_actor_ref<A, F>(actor: ActorRef<A>, make_message: F) -> Self
Adapt a Ractor actor ref into a sharding entity ingress.
make_message maps each sharded M into the actor’s mailbox protocol.
Passivation and shard handoff stop the supplied actor ref. Once that
actor begins draining or stopping, the next sharding delivery creates a
fresh entity from the registered factory.
Sourcepub fn tell(&self, message: M) -> ShardingResult<()>
pub fn tell(&self, message: M) -> ShardingResult<()>
Deliver one sharded message to the entity actor’s mailbox.
Sourcepub fn is_stopped(&self) -> bool
pub fn is_stopped(&self) -> bool
Return whether the entity actor has begun stopping.
Trait Implementations§
Auto Trait Implementations§
impl<M> !RefUnwindSafe for ActorEntityHandle<M>
impl<M> !UnwindSafe for ActorEntityHandle<M>
impl<M> Freeze for ActorEntityHandle<M>
impl<M> Send for ActorEntityHandle<M>
impl<M> Sync for ActorEntityHandle<M>
impl<M> Unpin for ActorEntityHandle<M>
impl<M> UnsafeUnpin for ActorEntityHandle<M>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage