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<Namespace, NamespaceError>
pub fn parse(value: &str) -> Result<Namespace, 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 :.
Sourcepub fn local() -> Namespace
pub fn local() -> Namespace
Construct the default "local" namespace (always valid; no allocation).
Sourcepub fn into_inner(self) -> String
pub fn into_inner(self) -> String
Consume the Namespace and return the underlying owned string.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Namespace
impl<'de> Deserialize<'de> for Namespace
Source§fn deserialize<D>(d: D) -> Result<Namespace, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<Namespace, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Namespace
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
Source§impl Serialize for Namespace
impl Serialize for Namespace
Source§fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.