pub struct ActorMesh<A: Referable> { /* private fields */ }Expand description
An ActorMesh is a collection of ranked A-typed actors: the lifecycle owner
over an ActorMeshRef, which is the cast/address surface.
The mesh may be managed — created via ProcMesh and backed by a controller
— or data-only — spawned through an ActorSpawner and carrying each rank’s
local lifecycle handle. Both variants own their actors and can stop them.
Monitoring works through the mesh’s members in either case.
Bound note: A: Referable because the mesh stores/returns ActorRef<A>,
which is only defined for A: Referable.
Implementations§
Methods from Deref<Target = ActorMeshRef<A>>§
Sourcepub fn as_managed(&self) -> Option<&ManagedActorMeshRef<A>>
pub fn as_managed(&self) -> Option<&ManagedActorMeshRef<A>>
Return the legacy dense ref when this is the managed variant.
Sourcepub fn id(&self) -> &ActorMeshId
pub fn id(&self) -> &ActorMeshId
Return the mesh id.
Sourcepub fn cast<M>(&self, cx: &impl Actor, message: M) -> Result<()>
pub fn cast<M>(&self, cx: &impl Actor, message: M) -> Result<()>
Cast a message to all the actors in this mesh.
This initiates delivery without waiting for it; use Self::monitor to
observe actors that stop or fail.
pub fn cast_with_headers<M>( &self, cx: &impl Actor, caller_headers: &Flattrs, message: M, ) -> Result<()>
Sourcepub fn cast_with_return_undeliverable<M>(
&self,
cx: &impl Actor,
caller_headers: &Flattrs,
message: M,
return_undeliverable: bool,
) -> Result<()>
pub fn cast_with_return_undeliverable<M>( &self, cx: &impl Actor, caller_headers: &Flattrs, message: M, return_undeliverable: bool, ) -> Result<()>
Cast message with explicit undeliverable-return behavior.
Sourcepub async fn next_supervision_event(
&self,
cx: &impl Actor,
) -> Result<MeshFailure, Error>
pub async fn next_supervision_event( &self, cx: &impl Actor, ) -> Result<MeshFailure, Error>
Return the next supervision event observed on this mesh.
Sourcepub fn clone_with_supervision_receiver(&self) -> Self
pub fn clone_with_supervision_receiver(&self) -> Self
Sourcepub fn monitor(&self, cx: &impl Actor) -> MeshMonitor
pub fn monitor(&self, cx: &impl Actor) -> MeshMonitor
Create a new, independent monitor over every rank.
Trait Implementations§
Source§impl<A: Referable> Clone for ActorMesh<A>
Manual implementation of Clone because A doesn’t need to implement Clone
but we still want to be able to clone the ActorMesh.
impl<A: Referable> Clone for ActorMesh<A>
Manual implementation of Clone because A doesn’t need to implement Clone
but we still want to be able to clone the ActorMesh.
Auto Trait Implementations§
impl<A> !RefUnwindSafe for ActorMesh<A>
impl<A> !UnwindSafe for ActorMesh<A>
impl<A> Freeze for ActorMesh<A>
impl<A> Send for ActorMesh<A>
impl<A> Sync for ActorMesh<A>
impl<A> Unpin for ActorMesh<A>
impl<A> UnsafeUnpin for ActorMesh<A>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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,
§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].