pub struct Partition {
pub part_type_guid: PartitionType,
pub part_guid: Uuid,
pub first_lba: u64,
pub last_lba: u64,
pub flags: u64,
pub name: String,
}
Expand description
A partition entry in a GPT partition table.
Fields
part_type_guid: PartitionType
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.
Implementations
sourceimpl Partition
impl Partition
sourcepub fn write(&self, p: &Path, h: &Header, lb_size: LogicalBlockSize) -> Result<()>
pub fn write(&self, p: &Path, h: &Header, lb_size: LogicalBlockSize) -> Result<()>
Write the partition entry to the partitions area and update crc32 for the Header.
sourcepub fn bytes_len(&self, lb_size: LogicalBlockSize) -> Result<u64>
pub fn bytes_len(&self, lb_size: LogicalBlockSize) -> Result<u64>
Return the length (in bytes) of this partition.
sourcepub fn bytes_start(&self, lb_size: LogicalBlockSize) -> Result<u64>
pub fn bytes_start(&self, lb_size: LogicalBlockSize) -> Result<u64>
Return the starting offset (in bytes) of this partition.
Trait Implementations
impl Eq for Partition
impl StructuralEq for Partition
impl StructuralPartialEq for Partition
Auto Trait Implementations
impl RefUnwindSafe for Partition
impl Send for Partition
impl Sync for Partition
impl Unpin for Partition
impl UnwindSafe for Partition
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more