pub struct Header {Show 14 fields
pub signature: String,
pub revision: (u16, u16),
pub header_size_le: u32,
pub crc32: u32,
pub reserved: u32,
pub current_lba: u64,
pub backup_lba: u64,
pub first_usable: u64,
pub last_usable: u64,
pub disk_guid: Uuid,
pub part_start: u64,
pub num_parts: u32,
pub part_size: u32,
pub crc32_parts: u32,
}Expand description
Header describing a GPT disk.
Fields§
§signature: StringGPT header magic signature, hardcoded to “EFI PART”.
revision: (u16, u16)major, minor
header_size_le: u32little endian
crc32: u32CRC32 of the header, will be incorrect after changing something until the header get’s written
reserved: u32must be 0
current_lba: u64For main header, 1
backup_lba: u64LBA for backup header
first_usable: u64First usable LBA for partitions (primary table last LBA + 1)
last_usable: u64Last usable LBA (secondary partition table first LBA - 1)
disk_guid: UuidUUID of the disk
part_start: u64Starting LBA of partition entries
num_parts: u32Number of partition entries
part_size: u32Size of a partition entry, usually 128
crc32_parts: u32CRC32 of the partition table, will be incorrect after changing something until the header get’s written
Implementations§
Source§impl Header
impl Header
Sourcepub fn write_primary<D: Read + Write + Seek>(
&mut self,
file: &mut D,
lb_size: LogicalBlockSize,
) -> Result<usize, HeaderError>
pub fn write_primary<D: Read + Write + Seek>( &mut self, file: &mut D, lb_size: LogicalBlockSize, ) -> Result<usize, HeaderError>
Write the primary header.
Sourcepub fn write_backup<D: Read + Write + Seek>(
&mut self,
file: &mut D,
lb_size: LogicalBlockSize,
) -> Result<usize, HeaderError>
pub fn write_backup<D: Read + Write + Seek>( &mut self, file: &mut D, lb_size: LogicalBlockSize, ) -> Result<usize, HeaderError>
Write the backup header.
Trait Implementations§
impl Eq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more