pub struct Namespace(/* private fields */);Expand description
A validated, opaque namespace identifier.
Construct via Namespace::parse or Namespace::local. The absence of
From<String> / From<&str> impls is intentional — callers must validate.
Implementations§
Source§impl Namespace
impl Namespace
Sourcepub fn parse(value: &str) -> Result<Self, NamespaceError>
pub fn parse(value: &str) -> Result<Self, NamespaceError>
Parse and validate a namespace string.
Returns Err(NamespaceError) if the string is empty, too long, contains
invalid characters, has empty segments, or ends with :.
pub fn as_str(&self) -> &str
pub fn into_inner(self) -> String
Trait Implementations§
Source§impl Ord for Namespace
impl Ord for Namespace
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Namespace
impl PartialOrd for Namespace
impl Eq for Namespace
impl StructuralPartialEq for Namespace
Auto Trait Implementations§
impl Freeze for Namespace
impl RefUnwindSafe for Namespace
impl Send for Namespace
impl Sync for Namespace
impl Unpin for Namespace
impl UnsafeUnpin for Namespace
impl UnwindSafe for Namespace
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