pub struct SystemWideUserId(UserId);
Expand description
A guaranteed to be system-wide [NetHsm
][nethsm::NetHsm
] user
Tuple Fields§
§0: UserId
Implementations§
Source§impl SystemWideUserId
impl SystemWideUserId
Sourcepub fn new(user_id: String) -> Result<Self, Error>
pub fn new(user_id: String) -> Result<Self, Error>
Creates a new SystemWideUserId
from an owned string
§Errors
Returns an error, if the provided user_id
contains a namespace.
§Examples
use nethsm_config::SystemWideUserId;
SystemWideUserId::new("user1".to_string())?;
// this fails because the User ID contains a namespace
assert!(SystemWideUserId::new("ns1~user1".to_string()).is_err());
Trait Implementations§
Source§impl Clone for SystemWideUserId
impl Clone for SystemWideUserId
Source§fn clone(&self) -> SystemWideUserId
fn clone(&self) -> SystemWideUserId
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 SystemWideUserId
impl Debug for SystemWideUserId
Source§impl<'de> Deserialize<'de> for SystemWideUserId
impl<'de> Deserialize<'de> for SystemWideUserId
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 SystemWideUserId
impl Display for SystemWideUserId
Source§impl From<SystemWideUserId> for String
impl From<SystemWideUserId> for String
Source§fn from(value: SystemWideUserId) -> Self
fn from(value: SystemWideUserId) -> Self
Converts to this type from the input type.
Source§impl From<SystemWideUserId> for UserId
impl From<SystemWideUserId> for UserId
Source§fn from(value: SystemWideUserId) -> Self
fn from(value: SystemWideUserId) -> Self
Converts to this type from the input type.
Source§impl FromStr for SystemWideUserId
impl FromStr for SystemWideUserId
Source§impl Hash for SystemWideUserId
impl Hash for SystemWideUserId
Source§impl PartialEq for SystemWideUserId
impl PartialEq for SystemWideUserId
Source§impl Serialize for SystemWideUserId
impl Serialize for SystemWideUserId
Source§impl TryFrom<String> for SystemWideUserId
impl TryFrom<String> for SystemWideUserId
impl Eq for SystemWideUserId
impl StructuralPartialEq for SystemWideUserId
Auto Trait Implementations§
impl Freeze for SystemWideUserId
impl RefUnwindSafe for SystemWideUserId
impl Send for SystemWideUserId
impl Sync for SystemWideUserId
impl Unpin for SystemWideUserId
impl UnwindSafe for SystemWideUserId
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.