pub enum NsScope {
Exact(String),
Prefix {
base: String,
sep: char,
},
}Expand description
A parsed namespace scope: exactly one namespace, or a prefix family.
Variants§
Exact(String)
An exact namespace name (contains no *).
Prefix
<base><sep>*: the namespace base itself plus every namespace
starting with base followed by sep — parent + descendants.
Implementations§
Source§impl NsScope
impl NsScope
Sourcepub fn parse(value: &str) -> Result<NsScope>
pub fn parse(value: &str) -> Result<NsScope>
Parse a namespace value from any query surface. "org" → Exact;
"org.*" → Prefix{base: "org", sep: '.'}. Any other placement of
* is a validation error, never a silent exact-match miss.
Sourcepub fn is_pattern(value: &str) -> bool
pub fn is_pattern(value: &str) -> bool
Whether this value even looks like a pattern (contains *). Cheap
pre-check that keeps exact-namespace hot paths at one byte scan.
Trait Implementations§
impl Eq for NsScope
impl StructuralPartialEq for NsScope
Auto Trait Implementations§
impl Freeze for NsScope
impl RefUnwindSafe for NsScope
impl Send for NsScope
impl Sync for NsScope
impl Unpin for NsScope
impl UnsafeUnpin for NsScope
impl UnwindSafe for NsScope
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