Skip to main content

GPTHeader

Struct GPTHeader 

Source
#[repr(C, align(1))]
pub struct GPTHeader {
Show 14 fields pub signature: [u8; 8], pub revision: LittleEndian<u32>, pub header_size_le: LittleEndian<u32>, pub header_crc32: LittleEndian<u32>, pub reserved: LittleEndian<u32>, pub current_lba: LittleEndian<u64>, pub backup_lba: LittleEndian<u64>, pub first_usable: LittleEndian<u64>, pub last_usable: LittleEndian<u64>, pub disk_guid: Uuid, pub part_start_lba: LittleEndian<u64>, pub num_parts: LittleEndian<u32>, pub part_size: LittleEndian<u32>, pub part_table_crc32: LittleEndian<u32>,
}

Fields§

§signature: [u8; 8]

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

§revision: LittleEndian<u32>

00 00 01 00

§header_size_le: LittleEndian<u32>

little endian

§header_crc32: LittleEndian<u32>

CRC32 of the header with crc32 section zeroed

§reserved: LittleEndian<u32>

must be 0

§current_lba: LittleEndian<u64>

For main header, 1

§backup_lba: LittleEndian<u64>

LBA for backup header

§first_usable: LittleEndian<u64>

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

§last_usable: LittleEndian<u64>

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

§disk_guid: Uuid

UUID of the disk

§part_start_lba: LittleEndian<u64>

Starting LBA of partition entries

§num_parts: LittleEndian<u32>

Number of partition entries

§part_size: LittleEndian<u32>

Size of a partition entry, usually 128

§part_table_crc32: LittleEndian<u32>

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 duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for GPTHeader

Source§

impl Debug for GPTHeader

Source§

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

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

impl Eq for GPTHeader

Source§

impl PartialEq for GPTHeader

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GPTHeader

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.