pub struct AnyActorHandle { /* private fields */ }Expand description
A type-erased handle to a running actor whose concrete type is erased.
This handle intentionally does not expose typed messaging or binding APIs.
Use AnyActorHandle::downcast to recover a typed ActorHandle when the
concrete actor type is known.
Implementations§
Source§impl AnyActorHandle
impl AnyActorHandle
Sourcepub fn drain_and_stop(&self, reason: &str) -> Result<(), ActorError>
pub fn drain_and_stop(&self, reason: &str) -> Result<(), ActorError>
Signal the actor to drain its current messages and then stop.
Sourcepub fn stop(&self, reason: &str) -> Result<(), ActorError>
pub fn stop(&self, reason: &str) -> Result<(), ActorError>
Signal the actor to stop without draining ordinary queued work first.
Sourcepub fn kill(&self, reason: &str) -> Result<(), ActorError>
pub fn kill(&self, reason: &str) -> Result<(), ActorError>
Signal the actor to terminate immediately.
Sourcepub fn status(&self) -> Receiver<ActorStatus>
pub fn status(&self) -> Receiver<ActorStatus>
A watch that observes the lifecycle state of the actor.
Sourcepub fn downcast<A: Actor>(&self) -> Option<ActorHandle<A>>
pub fn downcast<A: Actor>(&self) -> Option<ActorHandle<A>>
Attempt to recover a typed actor handle.
Sourcepub fn into_guard(self) -> AnyActorGuard
pub fn into_guard(self) -> AnyActorGuard
Convert this handle into a guard that stops the actor when dropped.
Dropping the returned guard sends a normal stop signal. The guard does not wait for the actor to stop.
Trait Implementations§
Source§impl Clone for AnyActorHandle
impl Clone for AnyActorHandle
Source§impl Debug for AnyActorHandle
impl Debug for AnyActorHandle
Source§impl IntoFuture for AnyActorHandle
IntoFuture allows users to await the handle to join it. The future
resolves when the actor runtime has fully stopped.
The future resolves to the actor’s final status.
impl IntoFuture for AnyActorHandle
IntoFuture allows users to await the handle to join it. The future resolves when the actor runtime has fully stopped. The future resolves to the actor’s final status.
Source§type Output = ActorStatus
type Output = ActorStatus
Source§type IntoFuture = Pin<Box<dyn Future<Output = <AnyActorHandle as IntoFuture>::Output> + Send>>
type IntoFuture = Pin<Box<dyn Future<Output = <AnyActorHandle as IntoFuture>::Output> + Send>>
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Auto Trait Implementations§
impl Freeze for AnyActorHandle
impl !RefUnwindSafe for AnyActorHandle
impl Send for AnyActorHandle
impl Sync for AnyActorHandle
impl Unpin for AnyActorHandle
impl UnsafeUnpin for AnyActorHandle
impl !UnwindSafe for AnyActorHandle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].