[][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]

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]

impl Debug 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]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

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]

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

type Owned = T

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.