pub struct ResourceId(/* private fields */);Expand description
Identifies a resource in the mesh system.
Identity (Eq, Hash, Ord) is determined by the underlying Uid.
Implementations§
Source§impl ResourceId
impl ResourceId
Sourcepub fn new(uid: Uid, label: Option<Label>) -> Self
pub fn new(uid: Uid, label: Option<Label>) -> Self
Create a ResourceId with explicit uid and label.
Sourcepub fn singleton(label: Label) -> Self
pub fn singleton(label: Label) -> Self
Create a singleton ResourceId identified by label.
The label becomes the uid; no separate label metadata is stored.
Sourcepub fn instance(label: Label) -> Self
pub fn instance(label: Label) -> Self
Create an instance ResourceId with a random uid and the given label.
Sourcepub fn from_name(name: impl AsRef<str>) -> Self
pub fn from_name(name: impl AsRef<str>) -> Self
Create a resource id from a resource-name string.
This accepts the mesh resource-id grammar, falling back to a stripped singleton label for legacy call sites that pass arbitrary names.
Sourcepub fn display_label(&self) -> Option<&Label>
pub fn display_label(&self) -> Option<&Label>
Returns the human-facing label for this resource id.
This is the explicit label metadata for instances, or the singleton
label embedded in the uid. Telemetry uses this for given_name.
Trait Implementations§
Source§impl Clone for ResourceId
impl Clone for ResourceId
Source§fn clone(&self) -> ResourceId
fn clone(&self) -> ResourceId
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResourceId
impl Debug for ResourceId
Source§impl<'de> Deserialize<'de> for ResourceId
impl<'de> Deserialize<'de> for ResourceId
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 Display for ResourceId
impl Display for ResourceId
Source§impl From<&ProcAddr> for ResourceId
impl From<&ProcAddr> for ResourceId
Source§impl From<&ProcId> for ResourceId
impl From<&ProcId> for ResourceId
Source§impl From<&ResourceId> for ProcId
impl From<&ResourceId> for ProcId
Source§fn from(id: &ResourceId) -> Self
fn from(id: &ResourceId) -> Self
Source§impl From<&ResourceId> for Uid
impl From<&ResourceId> for Uid
Source§fn from(id: &ResourceId) -> Self
fn from(id: &ResourceId) -> Self
Source§impl From<ActorMeshId> for ResourceId
impl From<ActorMeshId> for ResourceId
Source§fn from(id: ActorMeshId) -> Self
fn from(id: ActorMeshId) -> Self
Source§impl From<HostMeshId> for ResourceId
impl From<HostMeshId> for ResourceId
Source§fn from(id: HostMeshId) -> Self
fn from(id: HostMeshId) -> Self
Source§impl From<ProcId> for ResourceId
impl From<ProcId> for ResourceId
Source§impl From<ProcMeshId> for ResourceId
impl From<ProcMeshId> for ResourceId
Source§fn from(id: ProcMeshId) -> Self
fn from(id: ProcMeshId) -> Self
Source§impl From<ResourceId> for ActorMeshId
impl From<ResourceId> for ActorMeshId
Source§fn from(id: ResourceId) -> Self
fn from(id: ResourceId) -> Self
Source§impl From<ResourceId> for HostMeshId
impl From<ResourceId> for HostMeshId
Source§fn from(id: ResourceId) -> Self
fn from(id: ResourceId) -> Self
Source§impl From<ResourceId> for ProcId
impl From<ResourceId> for ProcId
Source§fn from(id: ResourceId) -> Self
fn from(id: ResourceId) -> Self
Source§impl From<ResourceId> for ProcMeshId
impl From<ResourceId> for ProcMeshId
Source§fn from(id: ResourceId) -> Self
fn from(id: ResourceId) -> Self
Source§impl From<ResourceId> for Uid
impl From<ResourceId> for Uid
Source§fn from(id: ResourceId) -> Self
fn from(id: ResourceId) -> Self
Source§impl FromStr for ResourceId
impl FromStr for ResourceId
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parses the canonical resource-id string forms accepted by the mesh control plane.
Accepted inputs are:
labelfor singletonslabel-uid58for labeled instances
resource-uid58 parses as an instance without explicit label metadata.
Source§type Err = ResourceIdParseError
type Err = ResourceIdParseError
Source§impl Hash for ResourceId
impl Hash for ResourceId
Source§impl Named for ResourceId
impl Named for ResourceId
Source§fn typename() -> &'static str
fn typename() -> &'static str
Source§fn typehash() -> u64
fn typehash() -> u64
Source§fn typeid() -> TypeId
fn typeid() -> TypeId
Source§fn port() -> u64
fn port() -> u64
Source§impl Ord for ResourceId
impl Ord for ResourceId
Source§impl PartialEq for ResourceId
impl PartialEq for ResourceId
Source§impl PartialOrd for ResourceId
impl PartialOrd for ResourceId
Source§impl Serialize for ResourceId
impl Serialize for ResourceId
impl Eq for ResourceId
Auto Trait Implementations§
impl Freeze for ResourceId
impl RefUnwindSafe for ResourceId
impl Send for ResourceId
impl Sync for ResourceId
impl Unpin for ResourceId
impl UnsafeUnpin for ResourceId
impl UnwindSafe for ResourceId
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<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
key and return true if they are equal.§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<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].