pub struct ProcMesh { /* private fields */ }
Expand description
A ProcMesh maintains a mesh of procs whose lifecycles are managed by an allocator.
Implementations§
Source§impl ProcMesh
impl ProcMesh
pub async fn allocate( alloc: impl Alloc + Send + Sync + 'static, ) -> Result<Self, AllocatorError>
Sourcepub async fn allocate_boxed(
alloc: Box<dyn Alloc + Send + Sync>,
) -> Result<Self, AllocatorError>
pub async fn allocate_boxed( alloc: Box<dyn Alloc + Send + Sync>, ) -> Result<Self, AllocatorError>
Allocate a new ProcMesh from the provided allocator. Allocate returns after the mesh has been successfully (and fully) allocated, returning early on any allocation failure.
Sourcepub async fn spawn<A: Actor + RemoteActor>(
&self,
actor_name: &str,
params: &A::Params,
) -> Result<RootActorMesh<'_, A>, Error>where
A::Params: RemoteMessage,
pub async fn spawn<A: Actor + RemoteActor>(
&self,
actor_name: &str,
params: &A::Params,
) -> Result<RootActorMesh<'_, A>, Error>where
A::Params: RemoteMessage,
Spawn an ActorMesh
by launching the same actor type on all
agents, using the same parameters instance for every
actor.
actor_name
: Name for all spawned actors.params
: Reference to the parameter struct, reused for all actors.
pub fn client_proc(&self) -> &Proc
pub fn proc_id(&self) -> &ProcId
pub fn world_id(&self) -> &WorldId
Sourcepub fn events(&mut self) -> Option<ProcEvents>
pub fn events(&mut self) -> Option<ProcEvents>
An event stream of proc events. Each ProcMesh can produce only one such stream, returning None after the first call.
pub fn shape(&self) -> &Shape
Trait Implementations§
Source§impl Mesh for ProcMesh
impl Mesh for ProcMesh
Source§type Id = ProcMeshId
type Id = ProcMeshId
The type of identifiers for this mesh.
Source§type Sliced<'a> = SlicedProcMesh<'a>
type Sliced<'a> = SlicedProcMesh<'a>
The type of a slice of this mesh. Slices should not outlive their
parent mesh.
Source§fn select<R: Into<Range>>(
&self,
label: &str,
range: R,
) -> Result<Self::Sliced<'_>, ShapeError>
fn select<R: Into<Range>>( &self, label: &str, range: R, ) -> Result<Self::Sliced<'_>, ShapeError>
Sub-slice this mesh, specifying the included ranges for
the dimension with the labeled name.
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
Mutably borrows from an owned value. Read more
§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