pub struct VmId(/* private fields */);Expand description
The identity of a VM: a plain name — non-empty, at most 64 characters,
and [A-Za-z0-9-].
Drivers use it as a runtime-directory and socket-name component, and hand
it to the VMM as the instance id it runs under. The alphabet is therefore
the intersection of what those uses allow, not the union: Firecracker
validates its --id as [A-Za-z0-9-], 1..=64, and panics on anything
else — Invalid instance ID: InvalidChar('_', 4), raised from inside
whatever task spawned the VMM, with nothing tying it back to the request
that supplied the id. A separator this type accepted but a driver could
not run would be a promise the port cannot keep, so it accepts only -.
MAX_LEN is that same VMM-imposed 64.
A driver-internal name that never becomes a VMM identity — DiskSpec::id
is the one here — keeps the wider path-safe alphabet (. and _ too).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for VmId
impl<'de> Deserialize<'de> for VmId
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 VmId
Source§impl Ord for VmId
impl Ord for VmId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for VmId
impl PartialOrd for VmId
impl StructuralPartialEq for VmId
Auto Trait Implementations§
impl Freeze for VmId
impl RefUnwindSafe for VmId
impl Send for VmId
impl Sync for VmId
impl Unpin for VmId
impl UnsafeUnpin for VmId
impl UnwindSafe for VmId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.