pub(super) enum Serde {
Bool(bool),
Str(String),
Num(u32),
Name {
name: String,
},
Raw {
raw_name: OsString,
},
Special {
special: String,
},
Id {
id: u32,
},
}
Available on
target_family="unix"
and non-iOS and non-Android and non-tvOS and crate feature serde
only.Expand description
Helper type: when encoding or decoding a group or user, we do so as one of these.
It’s an untagged
enumeration, so every case must be uniquely identifiable
by type or by keywords.
Variants§
Bool(bool)
A boolean value.
“false” means “no user”, and is the same as “none”.
“true” is not allowed.
Str(String)
A string given in quotes.
If this starts with “:” it will be interpreted as a special entity (e.g. “:current” or “:username”). Otherwise, it will be interpreted as a name.
Num(u32)
An integer provided without any identification.
This will be interpreted as a UID or GID.
Name
A name, explicitly qualified as such.
Fields
Raw
A username that cannot be represented as a String.
Special
A special entity.
Id
A UID or GID, explicitly qualified as such.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Serde
impl<'de> Deserialize<'de> for Serde
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 From<TrustedGroup> for Serde
impl From<TrustedGroup> for Serde
Source§fn from(value: TrustedGroup) -> Self
fn from(value: TrustedGroup) -> Self
Converts to this type from the input type.
Source§impl From<TrustedUser> for Serde
impl From<TrustedUser> for Serde
Source§fn from(value: TrustedUser) -> Self
fn from(value: TrustedUser) -> Self
Converts to this type from the input type.
Source§impl TryFrom<Serde> for TrustedGroup
impl TryFrom<Serde> for TrustedGroup
Auto Trait Implementations§
impl Freeze for Serde
impl RefUnwindSafe for Serde
impl Send for Serde
impl Sync for Serde
impl Unpin for Serde
impl UnwindSafe for Serde
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