[−][src]Struct partition_identity::PartitionID
Describes a partition identity.
A device path may be recovered from this.
Notes
This is a struct instead of an enum to make access to the id
string
easier for situations where the variant does not need to be checked.
Fields
variant: PartitionSource
id: String
Methods
impl PartitionID
[src]
pub fn new(variant: PartitionSource, id: String) -> Self
[src]
Construct a new PartitionID
as the given source.
pub fn new_id(id: String) -> Self
[src]
Construct a new PartitionID
as a ID
source.
pub fn new_label(id: String) -> Self
[src]
Construct a new PartitionID
as a Label
source.
pub fn new_uuid(id: String) -> Self
[src]
Construct a new PartitionID
as a UUID
source.
pub fn new_partlabel(id: String) -> Self
[src]
Construct a new PartitionID
as a PartLabel
source.
pub fn new_partuuid(id: String) -> Self
[src]
Construct a new PartitionID
as a PartUUID
source.
pub fn new_path(id: String) -> Self
[src]
Construct a new PartitionID
as a Path
source.
pub fn get_device_path(&self) -> Option<PathBuf>
[src]
Find the device path of this ID.
pub fn get_source<P: AsRef<Path>>(
variant: PartitionSource,
path: P
) -> Option<Self>
[src]
variant: PartitionSource,
path: P
) -> Option<Self>
Find the given source ID of the device at the given path.
pub fn get_uuid<P: AsRef<Path>>(path: P) -> Option<Self>
[src]
Find the UUID of the device at the given path.
pub fn get_partuuid<P: AsRef<Path>>(path: P) -> Option<Self>
[src]
Find the PARTUUID of the device at the given path.
pub fn from_disk_by_path<S: AsRef<str>>(path: S) -> Result<Self, Error>
[src]
Fetch a partition ID by a /dev/disk/by-
path.
Trait Implementations
impl Clone for PartitionID
[src]
fn clone(&self) -> PartitionID
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Eq for PartitionID
[src]
impl PartialEq<PartitionID> for PartitionID
[src]
fn eq(&self, other: &PartitionID) -> bool
[src]
fn ne(&self, other: &PartitionID) -> bool
[src]
impl Debug for PartitionID
[src]
impl FromStr for PartitionID
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(input: &str) -> Result<Self, Self::Err>
[src]
impl Hash for PartitionID
[src]
Auto Trait Implementations
impl Send for PartitionID
impl Sync for PartitionID
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,