pub enum Reference {
Proc(ProcId),
Actor(ActorId),
Port(PortId),
}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:
addr,proc_name,addr,proc_name,actor_name[pid],addr,proc_name,actor_name[pid][port]
Reference also implements a total ordering, so that references are ordered lexicographically with the hierarchy implied by proc, actor. This allows reference ordering to be used to implement prefix based routing.
Variants§
Proc(ProcId)
A reference to a proc.
Actor(ActorId)
A reference to an actor.
Port(PortId)
A reference to a port.
Implementations§
Source§impl Reference
impl Reference
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
Source§impl Reference
impl Reference
Sourcepub fn is_prefix_of(&self, other: &Reference) -> bool
pub fn is_prefix_of(&self, other: &Reference) -> bool
Tells whether this reference is a prefix of the provided reference.
Sourcepub fn kind(&self) -> ReferenceKind
pub fn kind(&self) -> ReferenceKind
Returns the kind of the reference.
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
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> QuoteExt for Twhere
T: ?Sized,
impl<T> QuoteExt for Twhere
T: ?Sized,
fn push_quoted<'q, Q, S>(&mut self, _q: Q, s: S)where
Q: QuoteInto<T>,
S: Into<Quotable<'q>>,
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.