pub struct ProcMesh { /* private fields */ }Expand description
A mesh of processes.
Implementations§
Methods from Deref<Target = ProcMeshRef>§
pub fn name(&self) -> &Name
pub fn host_mesh_name(&self) -> Option<&Name>
Sourcepub fn hosts(&self) -> Option<&HostMeshRef>
pub fn hosts(&self) -> Option<&HostMeshRef>
Returns the HostMeshRef that this ProcMeshRef might be backed by. Returns None if this ProcMeshRef is backed by an Alloc instead of a host mesh.
Sourcepub async fn status(&self, cx: &impl Actor) -> Result<ValueMesh<bool>>
pub async fn status(&self, cx: &impl Actor) -> Result<ValueMesh<bool>>
The current statuses of procs in this mesh.
Sourcepub async fn actor_states(
&self,
cx: &impl Actor,
name: Name,
) -> Result<ValueMesh<State<ActorState>>>
pub async fn actor_states( &self, cx: &impl Actor, name: Name, ) -> Result<ValueMesh<State<ActorState>>>
The supervision events of procs in this mesh.
pub async fn proc_states( &self, cx: &impl Actor, ) -> Result<Option<ValueMesh<State<ProcState>>>>
Sourcepub async fn spawn<A: RemoteSpawn, C: Actor>(
&self,
cx: &C,
name: &str,
params: &A::Params,
) -> Result<ActorMesh<A>>
pub async fn spawn<A: RemoteSpawn, C: Actor>( &self, cx: &C, name: &str, params: &A::Params, ) -> Result<ActorMesh<A>>
Spawn an actor on all of the procs in this mesh, returning a new ActorMesh.
Bounds:
A: Actor- the actor actually runs inside each proc.A: Referable- so we can return typedActorRef<A>s inside theActorMesh.A::Params: RemoteMessage- spawn parameters must be serializable and routable.
Sourcepub async fn spawn_service<A: RemoteSpawn, C: Actor>(
&self,
cx: &C,
name: &str,
params: &A::Params,
) -> Result<ActorMesh<A>>
pub async fn spawn_service<A: RemoteSpawn, C: Actor>( &self, cx: &C, name: &str, params: &A::Params, ) -> Result<ActorMesh<A>>
Spawn a ‘service’ actor. Service actors are singletons, using reserved names. The provided name is used verbatim as the actor’s name, and thus it may be persistently looked up by constructing the appropriate name.
Note: avoid using service actors if possible; the mechanism will be replaced by an actor registry.
Sourcepub async fn spawn_with_name<A: RemoteSpawn, C: Actor>(
&self,
cx: &C,
name: Name,
params: &A::Params,
supervision_display_name: Option<String>,
is_system_actor: bool,
) -> Result<ActorMesh<A>>
pub async fn spawn_with_name<A: RemoteSpawn, C: Actor>( &self, cx: &C, name: Name, params: &A::Params, supervision_display_name: Option<String>, is_system_actor: bool, ) -> Result<ActorMesh<A>>
Spawn an actor on all procs in this mesh under the given
Name, returning a new ActorMesh.
This is the underlying implementation used by [spawn]; it
differs only in that the actor name is passed explicitly
rather than as a &str.
Bounds:
A: Actor- the actor actually runs inside each proc.A: Referable- so we can return typedActorRef<A>s inside theActorMesh.A::Params: RemoteMessage- spawn parameters must be serializable and routable.C::A: Handler<MeshFailure>- in order to spawn actors, the actor must accept messages of typeMeshFailure. This is delivered when the actors spawned in the mesh have a failure that isn’t handled.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProcMesh
impl RefUnwindSafe for ProcMesh
impl Send for ProcMesh
impl Sync for ProcMesh
impl Unpin for ProcMesh
impl UnwindSafe for ProcMesh
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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<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>
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