pub enum NameOrId {
Id(u32),
Name(String),
}Expand description
A user or group as a start request names it: a numeric id, or a name the daemon
resolves against the guest’s /etc/passwd or /etc/group.
Untagged, so the wire carries a bare JSON integer or a bare JSON string and nothing
else. An integer serializes exactly as the u32 this field used to be, which is what
keeps a client that only ever sends ids byte-compatible with a daemon that predates
names. A string sent to such a daemon is refused as malformed_request rather than
misread.
A string that names no row and is all ASCII digits is read as that id, the way
docker exec -u 1000 reads it: a harness that carries a uid as a string reaches the
same account an integer would.
Variants§
Id(u32)
A numeric uid or gid, applied as given.
Name(String)
A user or group name, resolved in the guest before anything is spawned.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NameOrId
impl<'de> Deserialize<'de> for NameOrId
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>,
impl Eq for NameOrId
Source§impl FromStr for NameOrId
impl FromStr for NameOrId
Source§impl JsonSchema for NameOrId
impl JsonSchema for NameOrId
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more