[][src]Struct partition_identity::PartitionID

pub struct PartitionID {
    pub variant: PartitionSource,
    pub id: String,
}

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: PartitionSourceid: 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]

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]

impl Debug for PartitionID[src]

impl Display for PartitionID[src]

impl Eq for PartitionID[src]

impl FromStr for PartitionID[src]

type Err = Error

The associated error which can be returned from parsing.

impl Hash for PartitionID[src]

impl PartialEq<PartitionID> for PartitionID[src]

impl StructuralEq for PartitionID[src]

impl StructuralPartialEq for PartitionID[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.