pub enum Reference {
World(WorldId),
Proc(ProcId),
Actor(ActorId),
Port(PortId),
Gang(GangId),
}
Expand description
A universal reference to hierarchical identifiers in Hyperactor.
References implement a concrete syntax which can be parsed via
FromStr
. They are of the form:
world
,world[rank]
,world[rank].actor[pid]
,world[rank].port[pid][port]
, orworld.actor
Reference also implements a total ordering, so that references are ordered lexicographically with the hierarchy implied by world, proc, actor. This allows reference ordering to be used to implement prefix based routing.
Variants§
World(WorldId)
A reference to a world.
Proc(ProcId)
A reference to a proc.
Actor(ActorId)
A reference to an actor.
Port(PortId)
A reference to a port.
Gang(GangId)
A reference to a gang.
Implementations§
Source§impl Reference
impl Reference
Sourcepub fn as_world_mut(&mut self) -> Option<&mut WorldId>
pub fn as_world_mut(&mut self) -> Option<&mut WorldId>
Optionally returns mutable references to the inner fields if this is a Reference::World
, otherwise None
Sourcepub fn as_world(&self) -> Option<&WorldId>
pub fn as_world(&self) -> Option<&WorldId>
Optionally returns references to the inner fields if this is a Reference::World
, otherwise None
Sourcepub fn into_world(self) -> Result<WorldId, Self>
pub fn into_world(self) -> Result<WorldId, Self>
Returns the inner fields if this is a Reference::World
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn as_proc_mut(&mut self) -> Option<&mut ProcId>
pub fn as_proc_mut(&mut self) -> Option<&mut ProcId>
Optionally returns mutable references to the inner fields if this is a Reference::Proc
, otherwise None
Sourcepub fn as_proc(&self) -> Option<&ProcId>
pub fn as_proc(&self) -> Option<&ProcId>
Optionally returns references to the inner fields if this is a Reference::Proc
, otherwise None
Sourcepub fn into_proc(self) -> Result<ProcId, Self>
pub fn into_proc(self) -> Result<ProcId, Self>
Returns the inner fields if this is a Reference::Proc
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn as_actor_mut(&mut self) -> Option<&mut ActorId>
pub fn as_actor_mut(&mut self) -> Option<&mut ActorId>
Optionally returns mutable references to the inner fields if this is a Reference::Actor
, otherwise None
Sourcepub fn as_actor(&self) -> Option<&ActorId>
pub fn as_actor(&self) -> Option<&ActorId>
Optionally returns references to the inner fields if this is a Reference::Actor
, otherwise None
Sourcepub fn into_actor(self) -> Result<ActorId, Self>
pub fn into_actor(self) -> Result<ActorId, Self>
Returns the inner fields if this is a Reference::Actor
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn as_port_mut(&mut self) -> Option<&mut PortId>
pub fn as_port_mut(&mut self) -> Option<&mut PortId>
Optionally returns mutable references to the inner fields if this is a Reference::Port
, otherwise None
Sourcepub fn as_port(&self) -> Option<&PortId>
pub fn as_port(&self) -> Option<&PortId>
Optionally returns references to the inner fields if this is a Reference::Port
, otherwise None
Sourcepub fn into_port(self) -> Result<PortId, Self>
pub fn into_port(self) -> Result<PortId, Self>
Returns the inner fields if this is a Reference::Port
, otherwise returns back the enum in the Err
case of the result
Sourcepub fn as_gang_mut(&mut self) -> Option<&mut GangId>
pub fn as_gang_mut(&mut self) -> Option<&mut GangId>
Optionally returns mutable references to the inner fields if this is a Reference::Gang
, otherwise None
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Reference
impl<'de> Deserialize<'de> for Reference
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 Reference
impl Named for Reference
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
Source§impl Ord for Reference
impl Ord for Reference
Source§impl PartialOrd for Reference
impl PartialOrd for Reference
impl Eq for Reference
impl StructuralPartialEq for Reference
Auto Trait Implementations§
impl Freeze for Reference
impl RefUnwindSafe for Reference
impl Send for Reference
impl Sync for Reference
impl Unpin for Reference
impl UnwindSafe for Reference
Blanket Implementations§
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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