[][src]Struct gpt::partition::Partition

pub struct Partition {
    pub part_type_guid: Type,
    pub part_guid: Uuid,
    pub first_lba: u64,
    pub last_lba: u64,
    pub flags: u64,
    pub name: String,
}

A partition entry in a GPT partition table.

Fields

part_type_guid: Type

GUID of the partition type.

part_guid: Uuid

UUID of the partition.

first_lba: u64

First LBA of the partition.

last_lba: u64

Last LBA of the partition.

flags: u64

Partition flags.

name: String

Partition name.

Methods

impl Partition[src]

pub fn zero() -> Self[src]

Create a partition entry of type "unused", whose bytes are all 0s.

pub fn write(
    &self,
    p: &Path,
    partition_id: u64,
    start_lba: u64,
    lb_size: LogicalBlockSize
) -> Result<()>
[src]

Write the partition entry to the partitions area and update crc32 for the Header.

pub fn bytes_len(&self, lb_size: LogicalBlockSize) -> Result<u64>[src]

Return the length (in bytes) of this partition.

pub fn bytes_start(&self, lb_size: LogicalBlockSize) -> Result<u64>[src]

Return the starting offset (in bytes) of this partition.

pub fn is_used(&self) -> bool[src]

Check whether this partition is in use.

pub fn size(&self) -> Result<u64>[src]

Return the number of sectors in the partition.

Trait Implementations

impl PartialEq<Partition> for Partition[src]

impl Clone for Partition[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for Partition[src]

impl Display for Partition[src]

impl Debug for Partition[src]

Auto Trait Implementations

impl Send for Partition

impl Sync for Partition

Blanket Implementations

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

type Owned = T

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

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

impl<T> From for T[src]

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.