pub struct EntityRef<M> { /* private fields */ }Expand description
Reference to one entity.
Implementations§
Source§impl<M> EntityRef<M>
impl<M> EntityRef<M>
Sourcepub async fn tell(&self, message: M) -> ShardingResult<()>
pub async fn tell(&self, message: M) -> ShardingResult<()>
Send one message at-most-once.
Sourcepub async fn passivate(&self) -> ShardingResult<()>
pub async fn passivate(&self) -> ShardingResult<()>
Passivate this entity if it is currently running.
The entity actor is stopped and removed from the local runtime on its current owner. A later message respawns the entity on demand. If the shard is moving, passivation is ordered through the same bounded handoff buffer as user messages.
Sourcepub async fn ask<R, F>(
&self,
timeout: Duration,
make_message: F,
) -> ShardingResult<R>
pub async fn ask<R, F>( &self, timeout: Duration, make_message: F, ) -> ShardingResult<R>
Send one message that carries a sharding ReplyPort.
Trait Implementations§
Auto Trait Implementations§
impl<M> !RefUnwindSafe for EntityRef<M>
impl<M> !UnwindSafe for EntityRef<M>
impl<M> Freeze for EntityRef<M>
impl<M> Send for EntityRef<M>where
M: Send,
impl<M> Sync for EntityRef<M>where
M: Sync,
impl<M> Unpin for EntityRef<M>where
M: Unpin,
impl<M> UnsafeUnpin for EntityRef<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