pub struct QualifiedId {
pub name: String,
pub scope: Scope,
}Expand description
A qualified identifier combining a local name with its scope.
Qualified IDs enable unambiguous resource identification across
the configuration hierarchy. They support both qualified references
(e.g., api:backend) and unqualified references that resolve
through the scope chain.
§Canonical Form
The canonical string representation uses : as a separator:
- Global:
"name" - Namespace:
"namespace:name" - Service:
"namespace:service:name"
Fields§
§name: StringThe local name within the scope
scope: ScopeThe scope where this resource is defined
Implementations§
Source§impl QualifiedId
impl QualifiedId
Sourcepub fn new(name: impl Into<String>, scope: Scope) -> Self
pub fn new(name: impl Into<String>, scope: Scope) -> Self
Create a new qualified ID with the given name and scope
Sourcepub fn namespaced(namespace: impl Into<String>, name: impl Into<String>) -> Self
pub fn namespaced(namespace: impl Into<String>, name: impl Into<String>) -> Self
Create a namespace-scoped qualified ID
Sourcepub fn in_service(
namespace: impl Into<String>,
service: impl Into<String>,
name: impl Into<String>,
) -> Self
pub fn in_service( namespace: impl Into<String>, service: impl Into<String>, name: impl Into<String>, ) -> Self
Create a service-scoped qualified ID
Sourcepub fn canonical(&self) -> String
pub fn canonical(&self) -> String
Returns the canonical string form of this qualified ID
Format:
- Global:
"name" - Namespace:
"namespace:name" - Service:
"namespace:service:name"
Sourcepub fn parse(s: &str) -> Self
pub fn parse(s: &str) -> Self
Parse a qualified ID from its canonical string form
Parsing rules:
- No colons: Global scope (
"name"→ Global) - One colon: Namespace scope (
"ns:name"→ Namespace) - Two+ colons: Service scope (
"ns:svc:name"→ Service)
Sourcepub fn is_qualified(&self) -> bool
pub fn is_qualified(&self) -> bool
Returns true if this is a qualified (non-global) ID
Trait Implementations§
Source§impl Clone for QualifiedId
impl Clone for QualifiedId
Source§fn clone(&self) -> QualifiedId
fn clone(&self) -> QualifiedId
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QualifiedId
impl Debug for QualifiedId
Source§impl<'de> Deserialize<'de> for QualifiedId
impl<'de> Deserialize<'de> for QualifiedId
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for QualifiedId
impl Display for QualifiedId
Source§impl From<&str> for QualifiedId
impl From<&str> for QualifiedId
Source§impl From<String> for QualifiedId
impl From<String> for QualifiedId
Source§impl Hash for QualifiedId
impl Hash for QualifiedId
Source§impl PartialEq for QualifiedId
impl PartialEq for QualifiedId
Source§impl Serialize for QualifiedId
impl Serialize for QualifiedId
impl Eq for QualifiedId
impl StructuralPartialEq for QualifiedId
Auto Trait Implementations§
impl Freeze for QualifiedId
impl RefUnwindSafe for QualifiedId
impl Send for QualifiedId
impl Sync for QualifiedId
impl Unpin for QualifiedId
impl UnwindSafe for QualifiedId
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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