pub enum ProcState {
Created {
proc_id: ProcId,
point: Point,
pid: u32,
},
Running {
proc_id: ProcId,
mesh_agent: ActorRef<MeshAgent>,
addr: ChannelAddr,
},
Stopped {
proc_id: ProcId,
reason: ProcStopReason,
},
Failed {
world_id: WorldId,
description: String,
},
}
Expand description
A proc’s status. A proc can only monotonically move from
Created
to Running
to Stopped
.
Variants§
Created
A proc was added to the alloc.
Fields
Running
A proc was started.
Fields
mesh_agent: ActorRef<MeshAgent>
Reference to this proc’s mesh agent. In the future, we’ll reserve a ‘well known’ PID (0) for this purpose.
addr: ChannelAddr
The address of this proc. The endpoint of this address is
the proc’s mailbox, which accepts hyperactor::mailbox::MessageEnvelope
s.
Stopped
A proc was stopped.
Failed
Allocation process encountered an irrecoverable error. Depending on the
implementation, the allocation process may continue transiently and calls
to next() may return some events. But eventually the allocation will not
be complete. Callers can use the description
to determine the reason for
the failure.
Allocation can then be cleaned up by calling stop()`` on the
Alloc` and
drain the iterator for clean shutdown.
Implementations§
Source§impl ProcState
impl ProcState
Sourcepub fn is_created(&self) -> bool
pub fn is_created(&self) -> bool
Returns true if this is a ProcState::Created
, otherwise false
Sourcepub fn as_created_mut(&mut self) -> Option<(&mut ProcId, &mut Point, &mut u32)>
pub fn as_created_mut(&mut self) -> Option<(&mut ProcId, &mut Point, &mut u32)>
Optionally returns mutable references to the inner fields if this is a ProcState::Created
, otherwise None
Sourcepub fn as_created(&self) -> Option<(&ProcId, &Point, &u32)>
pub fn as_created(&self) -> Option<(&ProcId, &Point, &u32)>
Optionally returns references to the inner fields if this is a ProcState::Created
, otherwise None
Sourcepub fn into_created(self) -> Result<(ProcId, Point, u32), Self>
pub fn into_created(self) -> Result<(ProcId, Point, u32), Self>
Returns the inner fields if this is a ProcState::Created
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Returns true if this is a ProcState::Running
, otherwise false
Sourcepub fn as_running_mut(
&mut self,
) -> Option<(&mut ProcId, &mut ActorRef<MeshAgent>, &mut ChannelAddr)>
pub fn as_running_mut( &mut self, ) -> Option<(&mut ProcId, &mut ActorRef<MeshAgent>, &mut ChannelAddr)>
Optionally returns mutable references to the inner fields if this is a ProcState::Running
, otherwise None
Sourcepub fn as_running(
&self,
) -> Option<(&ProcId, &ActorRef<MeshAgent>, &ChannelAddr)>
pub fn as_running( &self, ) -> Option<(&ProcId, &ActorRef<MeshAgent>, &ChannelAddr)>
Optionally returns references to the inner fields if this is a ProcState::Running
, otherwise None
Sourcepub fn into_running(
self,
) -> Result<(ProcId, ActorRef<MeshAgent>, ChannelAddr), Self>
pub fn into_running( self, ) -> Result<(ProcId, ActorRef<MeshAgent>, ChannelAddr), Self>
Returns the inner fields if this is a ProcState::Running
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn is_stopped(&self) -> bool
pub fn is_stopped(&self) -> bool
Returns true if this is a ProcState::Stopped
, otherwise false
Sourcepub fn as_stopped_mut(&mut self) -> Option<(&mut ProcId, &mut ProcStopReason)>
pub fn as_stopped_mut(&mut self) -> Option<(&mut ProcId, &mut ProcStopReason)>
Optionally returns mutable references to the inner fields if this is a ProcState::Stopped
, otherwise None
Sourcepub fn as_stopped(&self) -> Option<(&ProcId, &ProcStopReason)>
pub fn as_stopped(&self) -> Option<(&ProcId, &ProcStopReason)>
Optionally returns references to the inner fields if this is a ProcState::Stopped
, otherwise None
Sourcepub fn into_stopped(self) -> Result<(ProcId, ProcStopReason), Self>
pub fn into_stopped(self) -> Result<(ProcId, ProcStopReason), Self>
Returns the inner fields if this is a ProcState::Stopped
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn as_failed_mut(&mut self) -> Option<(&mut WorldId, &mut String)>
pub fn as_failed_mut(&mut self) -> Option<(&mut WorldId, &mut String)>
Optionally returns mutable references to the inner fields if this is a ProcState::Failed
, otherwise None
Sourcepub fn as_failed(&self) -> Option<(&WorldId, &String)>
pub fn as_failed(&self) -> Option<(&WorldId, &String)>
Optionally returns references to the inner fields if this is a ProcState::Failed
, otherwise None
Sourcepub fn into_failed(self) -> Result<(WorldId, String), Self>
pub fn into_failed(self) -> Result<(WorldId, String), Self>
Returns the inner fields if this is a ProcState::Failed
, otherwise returns back the enum in the Err
case of the result
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ProcState
impl<'de> Deserialize<'de> for ProcState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for ProcState
Auto Trait Implementations§
impl Freeze for ProcState
impl !RefUnwindSafe for ProcState
impl Send for ProcState
impl Sync for ProcState
impl Unpin for ProcState
impl !UnwindSafe for ProcState
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
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>
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