Enum vboxhelper::vmid::VmId [−][src]
Expand description
Identify a virtual machine.
The identifier can be created using the FromStr
trait which will
first attempt to parse the input parameters as an uuid, and fallback to
treat it as a name.
use vboxhelper::vmid::VmId; // will be treated as an VmId::Uuid let mid1 = "00112233-4455-6677-8899-aabbccddeeff".parse::<VmId>(); if let Ok(VmId::Uuid(_)) = mid1 { } else { panic!("Not an UUID!"); } // will be treated as an VmId::Name let mid2 = "myvim".parse::<VmId>(); if let Ok(VmId::Name(_)) = mid2 { } else { panic!("Not a name!"); }
Variants
Using a name is more human-friendly than an Uuid
, but it’s not
universally unique.
Tuple Fields of Name
0: String
The uuid is (supposed to be) univeraslly unique, but a little cumbersome to memorize or type out.
Tuple Fields of Uuid
0: Uuid
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for VmId
impl UnwindSafe for VmId
Blanket Implementations
Mutably borrows from an owned value. Read more