[−][src]Struct gpt::partition::Partition
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]
&self,
p: &Path,
partition_id: u64,
start_lba: u64,
lb_size: LogicalBlockSize
) -> Result<()>
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(&self) -> 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
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
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>,