pub struct Namespace(/* private fields */);Expand description
A validated namespace identifier.
Valid names contain only ASCII alphanumerics, hyphens (-), and
underscores (_), and are between 1 and 64 characters long.
The name "default" is valid and is the conventional namespace for
single-namespace deployments and migrated pre-namespace data.
Implementations§
Source§impl Namespace
impl Namespace
Sourcepub const DEFAULT: &'static str = "default"
pub const DEFAULT: &'static str = "default"
The conventional default namespace used for migration and single-ns deployments.
Sourcepub fn new(name: impl Into<String>) -> Result<Self, NamespaceError>
pub fn new(name: impl Into<String>) -> Result<Self, NamespaceError>
Parse and validate a namespace name.
Sourcepub fn default_ns() -> Self
pub fn default_ns() -> Self
Return the "default" namespace. Equivalent to
Namespace::new(Namespace::DEFAULT).unwrap().
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Namespace
impl<'de> Deserialize<'de> for Namespace
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
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