pub struct NamespaceId(String);
Expand description
NamespaceId
s are used as part of a UserId
or standalone for managing a namespace using
add_namespace
or
delete_namespace
.
Tuple Fields§
§0: String
Implementations§
source§impl NamespaceId
impl NamespaceId
sourcepub fn new(namespace_id: String) -> Result<Self, Error>
pub fn new(namespace_id: String) -> Result<Self, Error>
Creates a new NamespaceId
from owned String
The provided string must be in the character set [a-z0-9]
.
§Errors
Returns an Error
if
- the provided string contains an invalid character
§Examples
use nethsm::NamespaceId;
// a valid NamespaceId
assert!(NamespaceId::new("namespace1".to_string()).is_ok());
// an invalid NamespaceId
assert!(NamespaceId::new("namespace-1".to_string()).is_err());
Trait Implementations§
source§impl AsRef<str> for NamespaceId
impl AsRef<str> for NamespaceId
source§impl Clone for NamespaceId
impl Clone for NamespaceId
source§fn clone(&self) -> NamespaceId
fn clone(&self) -> NamespaceId
Returns a copy 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 NamespaceId
impl Debug for NamespaceId
source§impl<'de> Deserialize<'de> for NamespaceId
impl<'de> Deserialize<'de> for NamespaceId
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 NamespaceId
impl Display for NamespaceId
source§impl FromStr for NamespaceId
impl FromStr for NamespaceId
source§impl Hash for NamespaceId
impl Hash for NamespaceId
source§impl PartialEq for NamespaceId
impl PartialEq for NamespaceId
source§impl Serialize for NamespaceId
impl Serialize for NamespaceId
source§impl TryFrom<&str> for NamespaceId
impl TryFrom<&str> for NamespaceId
impl Eq for NamespaceId
impl StructuralPartialEq for NamespaceId
Auto Trait Implementations§
impl Freeze for NamespaceId
impl RefUnwindSafe for NamespaceId
impl Send for NamespaceId
impl Sync for NamespaceId
impl Unpin for NamespaceId
impl UnwindSafe for NamespaceId
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)