Struct gpt_parser::GPTHeader

source ·
#[repr(C, align(1))]
pub struct GPTHeader {
Show 14 fields pub signature: [u8; 8], pub revision: u32le, pub header_size_le: u32le, pub header_crc32: u32le, pub reserved: u32le, pub current_lba: u64le, pub backup_lba: u64le, pub first_usable: u64le, pub last_usable: u64le, pub disk_guid: Uuid, pub part_start_lba: u64le, pub num_parts: u32le, pub part_size: u32le, pub part_table_crc32: u32le,
}

Fields§

§signature: [u8; 8]

GPT header magic signature, hardcoded to “EFI PART”.

§revision: u32le

00 00 01 00

§header_size_le: u32le

little endian

§header_crc32: u32le

CRC32 of the header with crc32 section zeroed

§reserved: u32le

must be 0

§current_lba: u64le

For main header, 1

§backup_lba: u64le

LBA for backup header

§first_usable: u64le

First usable LBA for partitions (primary table last LBA + 1)

§last_usable: u64le

Last usable LBA (secondary partition table first LBA - 1)

§disk_guid: Uuid

UUID of the disk

§part_start_lba: u64le

Starting LBA of partition entries

§num_parts: u32le

Number of partition entries

§part_size: u32le

Size of a partition entry, usually 128

§part_table_crc32: u32le

CRC32 of the partition table

Implementations§

source§

impl GPTHeader

source

pub fn verify_signature(&self) -> bool

source

pub unsafe fn parse_gpt_header<'a, T: Sized + LBAIndex>( gpt_header_lba: &'a LBA<T> ) -> Result<&'a Self, &'static str>

source

pub fn parse_partitions<F: Fn(&GPTPartition, &mut T), T>( part_array: &[GPTPartition], size: usize, foreach: F, data: &mut T )

Trait Implementations§

source§

impl Clone for GPTHeader

source§

fn clone(&self) -> GPTHeader

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GPTHeader

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<GPTHeader> for GPTHeader

source§

fn eq(&self, other: &GPTHeader) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for GPTHeader

source§

impl Eq for GPTHeader

source§

impl StructuralEq for GPTHeader

source§

impl StructuralPartialEq for GPTHeader

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.