pub enum ProcState {
Created {
create_key: ShortUuid,
point: Point,
pid: u32,
},
Running {
create_key: ShortUuid,
proc_id: ProcId,
mesh_agent: ActorRef<ProcMeshAgent>,
addr: ChannelAddr,
},
Stopped {
create_key: ShortUuid,
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<ProcMeshAgent>Reference to this proc’s mesh agent. In the future, we’ll reserve a ‘well known’ PID (0) for this purpose.
addr: ChannelAddrThe address of this proc. The endpoint of this address is
the proc’s mailbox, which accepts hyperactor::mailbox::MessageEnvelopes.
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 ShortUuid, &mut Point, &mut u32)>
pub fn as_created_mut( &mut self, ) -> Option<(&mut ShortUuid, &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<(&ShortUuid, &Point, &u32)>
pub fn as_created(&self) -> Option<(&ShortUuid, &Point, &u32)>
Optionally returns references to the inner fields if this is a ProcState::Created, otherwise None
Sourcepub fn into_created(self) -> Result<(ShortUuid, Point, u32), Self>
pub fn into_created(self) -> Result<(ShortUuid, 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 ShortUuid, &mut ProcId, &mut ActorRef<ProcMeshAgent>, &mut ChannelAddr)>
pub fn as_running_mut( &mut self, ) -> Option<(&mut ShortUuid, &mut ProcId, &mut ActorRef<ProcMeshAgent>, &mut ChannelAddr)>
Optionally returns mutable references to the inner fields if this is a ProcState::Running, otherwise None
Sourcepub fn as_running(
&self,
) -> Option<(&ShortUuid, &ProcId, &ActorRef<ProcMeshAgent>, &ChannelAddr)>
pub fn as_running( &self, ) -> Option<(&ShortUuid, &ProcId, &ActorRef<ProcMeshAgent>, &ChannelAddr)>
Optionally returns references to the inner fields if this is a ProcState::Running, otherwise None
Sourcepub fn into_running(
self,
) -> Result<(ShortUuid, ProcId, ActorRef<ProcMeshAgent>, ChannelAddr), Self>
pub fn into_running( self, ) -> Result<(ShortUuid, ProcId, ActorRef<ProcMeshAgent>, 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 ShortUuid, &mut ProcStopReason)>
pub fn as_stopped_mut( &mut self, ) -> Option<(&mut ShortUuid, &mut ProcStopReason)>
Optionally returns mutable references to the inner fields if this is a ProcState::Stopped, otherwise None
Sourcepub fn as_stopped(&self) -> Option<(&ShortUuid, &ProcStopReason)>
pub fn as_stopped(&self) -> Option<(&ShortUuid, &ProcStopReason)>
Optionally returns references to the inner fields if this is a ProcState::Stopped, otherwise None
Sourcepub fn into_stopped(self) -> Result<(ShortUuid, ProcStopReason), Self>
pub fn into_stopped(self) -> Result<(ShortUuid, 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>,
Source§impl Named for ProcState
impl Named for ProcState
Source§fn typename() -> &'static str
fn typename() -> &'static str
Source§fn typehash() -> u64
fn typehash() -> u64
Source§fn arm(&self) -> Option<&'static str>
fn arm(&self) -> Option<&'static str>
Source§fn typeid() -> TypeId
fn typeid() -> TypeId
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> Checkpointable for Twhere
T: RemoteMessage + Clone,
impl<T> Checkpointable for Twhere
T: RemoteMessage + Clone,
Source§type State = T
type State = 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