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.
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 itself has stopped processing messages.
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 itself has stopped processing messages. The future resolves to the actor’s final status.
Source§type Output = ActorStatus
type Output = ActorStatus
The output that the future will produce on completion.
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>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
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
Mutably borrows from an owned value. Read more
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>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§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>
Converts
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>
Converts
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>
Wrap the input message
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>,
Applies the layer to a service and wraps it in [
Layered].