Struct partition_identity::PartitionID
source · pub struct PartitionID {
pub variant: PartitionSource,
pub id: String,
}
Expand description
Describes a partition identity.
A device path may be recovered from this.
Fields§
§variant: PartitionSource
§id: String
Implementations§
source§impl PartitionID
impl PartitionID
sourcepub fn new(variant: PartitionSource, id: String) -> Self
pub fn new(variant: PartitionSource, id: String) -> Self
Construct a new PartitionID
as the given source.
sourcepub fn new_partlabel(id: String) -> Self
pub fn new_partlabel(id: String) -> Self
Construct a new PartitionID
as a PartLabel
source.
sourcepub fn new_partuuid(id: String) -> Self
pub fn new_partuuid(id: String) -> Self
Construct a new PartitionID
as a PartUUID
source.
sourcepub fn get_device_path(&self) -> Option<PathBuf>
pub fn get_device_path(&self) -> Option<PathBuf>
Find the device path of this ID.
sourcepub fn get_source<P: AsRef<Path>>(
variant: PartitionSource,
path: P
) -> Option<Self>
pub fn get_source<P: AsRef<Path>>(
variant: PartitionSource,
path: P
) -> Option<Self>
Find the given source ID of the device at the given path.
sourcepub fn get_uuid<P: AsRef<Path>>(path: P) -> Option<Self>
pub fn get_uuid<P: AsRef<Path>>(path: P) -> Option<Self>
Find the UUID of the device at the given path.
sourcepub fn get_partuuid<P: AsRef<Path>>(path: P) -> Option<Self>
pub fn get_partuuid<P: AsRef<Path>>(path: P) -> Option<Self>
Find the PARTUUID of the device at the given path.
Trait Implementations§
source§impl Clone for PartitionID
impl Clone for PartitionID
source§fn clone(&self) -> PartitionID
fn clone(&self) -> PartitionID
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 more