#[repr(C, packed(1))]pub struct GptHeader {Show 14 fields
pub signature: GptHeaderSignature,
pub revision: GptHeaderRevision,
pub header_size: U32Le,
pub header_crc32: Crc32,
pub reserved: U32Le,
pub my_lba: LbaLe,
pub alternate_lba: LbaLe,
pub first_usable_lba: LbaLe,
pub last_usable_lba: LbaLe,
pub disk_guid: Guid,
pub partition_entry_lba: LbaLe,
pub number_of_partition_entries: U32Le,
pub size_of_partition_entry: U32Le,
pub partition_entry_array_crc32: Crc32,
}Expand description
GPT header that appears near the start and end of a GPT-formatted disk.
Fields§
§signature: GptHeaderSignatureMagic signature for the header. In a valid header this must be
GptHeaderSignature::EFI_COMPATIBLE_PARTITION_TABLE_HEADER.
revision: GptHeaderRevisionRevision number for the header. In a valid header this must be
GptHeaderRevision::VERSION_1_0.
header_size: U32LeSize of the header in bytes. In a valid header this must be greater than or equal to 92 bytes, and less than or equal to the block size.
header_crc32: Crc32CRC32 checksum of the entire header. When calculating the checksum, this field is included in the checksum as four zero bytes.
reserved: U32LeReserved bytes. In a valid header these must be all zero.
my_lba: LbaLeThe LBA that contains this header.
alternate_lba: LbaLeThe LBA that contains the alternate header.
first_usable_lba: LbaLeFirst LBA that can be used for the data of a partition in the partition entry array.
last_usable_lba: LbaLeLast LBA that can be used for the data of a partition in the partition entry array.
disk_guid: GuidUnique ID for the disk.
partition_entry_lba: LbaLeFirst LBA of the partition entry array.
number_of_partition_entries: U32LeNumber of partitions in the partition entry array.
size_of_partition_entry: U32LeSize in bytes of each entry in the partition entry array.
partition_entry_array_crc32: Crc32CRC32 checksum of the partition entry array.
Implementations§
Source§impl GptHeader
impl GptHeader
Sourcepub fn is_signature_valid(&self) -> bool
pub fn is_signature_valid(&self) -> bool
Check if the header’s signature matches
GptHeaderSignature::EFI_COMPATIBLE_PARTITION_TABLE_HEADER.
Sourcepub fn calculate_header_crc32(&self) -> Crc32
Available on crate feature bytemuck only.
pub fn calculate_header_crc32(&self) -> Crc32
bytemuck only.Calculate the header’s CRC32 checksum. This returns the checksum but does not update the checksum field in the header.
Sourcepub fn update_header_crc32(&mut self)
Available on crate feature bytemuck only.
pub fn update_header_crc32(&mut self)
bytemuck only.Update the header’s CRC32 checksum.
Sourcepub fn get_partition_entry_array_layout(
&self,
) -> Result<GptPartitionEntryArrayLayout, GptPartitionEntrySizeError>
pub fn get_partition_entry_array_layout( &self, ) -> Result<GptPartitionEntryArrayLayout, GptPartitionEntrySizeError>
Get the GptPartitionEntryArrayLayout for this header.
Trait Implementations§
Source§impl Ord for GptHeader
impl Ord for GptHeader
Source§impl PartialOrd for GptHeader
impl PartialOrd for GptHeader
impl Copy for GptHeader
impl Eq for GptHeader
impl Pod for GptHeader
impl StructuralPartialEq for GptHeader
Auto Trait Implementations§
impl Freeze for GptHeader
impl RefUnwindSafe for GptHeader
impl Send for GptHeader
impl Sync for GptHeader
impl Unpin for GptHeader
impl UnwindSafe for GptHeader
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
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.