pub struct SystemUserId(String);
Expand description
The name of a user on a Unix system
The username may only contain characters in the set of alphanumeric characters and the '_'
character.
Tuple Fields§
§0: String
Implementations§
Source§impl SystemUserId
impl SystemUserId
Sourcepub fn new(user: String) -> Result<Self, Error>
pub fn new(user: String) -> Result<Self, Error>
Creates a new SystemUserId
§Errors
Returns an error if user
contains chars other than alphanumeric ones, -
, or _
.
§Examples
use nethsm_config::SystemUserId;
SystemUserId::new("user1".to_string())?;
SystemUserId::new("User_1".to_string())?;
assert!(SystemUserId::new("?ser-1".to_string()).is_err());
Trait Implementations§
Source§impl AsRef<str> for SystemUserId
impl AsRef<str> for SystemUserId
Source§impl Clone for SystemUserId
impl Clone for SystemUserId
Source§fn clone(&self) -> SystemUserId
fn clone(&self) -> SystemUserId
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 SystemUserId
impl Debug for SystemUserId
Source§impl<'de> Deserialize<'de> for SystemUserId
impl<'de> Deserialize<'de> for SystemUserId
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 SystemUserId
impl Display for SystemUserId
Source§impl From<SystemUserId> for String
impl From<SystemUserId> for String
Source§fn from(value: SystemUserId) -> Self
fn from(value: SystemUserId) -> Self
Converts to this type from the input type.
Source§impl FromStr for SystemUserId
impl FromStr for SystemUserId
Source§impl Hash for SystemUserId
impl Hash for SystemUserId
Source§impl PartialEq for SystemUserId
impl PartialEq for SystemUserId
Source§impl Serialize for SystemUserId
impl Serialize for SystemUserId
Source§impl TryFrom<String> for SystemUserId
impl TryFrom<String> for SystemUserId
Source§impl Zeroize for SystemUserId
impl Zeroize for SystemUserId
impl Eq for SystemUserId
impl StructuralPartialEq for SystemUserId
Auto Trait Implementations§
impl Freeze for SystemUserId
impl RefUnwindSafe for SystemUserId
impl Send for SystemUserId
impl Sync for SystemUserId
impl Unpin for SystemUserId
impl UnwindSafe for SystemUserId
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.