[][src]Struct sunrise_fs::detail::gpt::GPTHeader

#[repr(packed)]pub struct GPTHeader {
    pub signature: u64,
    pub revision: u32,
    pub header_size: u32,
    pub crc32: u32,
    reserved: u32,
    pub current_lba: u64,
    pub backup_lba: u64,
    pub first_usable: u64,
    pub last_usable: u64,
    pub disk_guid: RawUUID,
    pub partition_table_start: u64,
    pub partition_entry_count: u32,
    pub partition_entry_size: u32,
    pub partition_table_crc32: u32,
}

The header of a GPT table.

Fields

signature: u64

Signature of a GPT header.

revision: u32

GPT revision.

header_size: u32

Header size.

crc32: u32

CRC over the header.

reserved: u32

Reserved field.

current_lba: u64

The LBA of this header.

backup_lba: u64

The LBA of the backup header.

first_usable: u64

The first usable LBA. (partition table entries)

last_usable: u64

The last usable LBA.

disk_guid: RawUUID

The GUID of this disk.

partition_table_start: u64

The LBA of the first partition entry.

partition_entry_count: u32

The count of partition entries.

partition_entry_size: u32

The size of a partition entry.

partition_table_crc32: u32

The CRC over all partition entries.

Implementations

impl GPTHeader[src]

pub const MAGIC: u64[src]

The magic of a GPT header ("EFI PART")

pub fn from_storage_device(
    storage_device: &mut dyn IStorage<Error = Error>,
    lba_index: u64
) -> LibUserResult<Self>
[src]

Read the GPT header from the disk

pub fn from_bytes(bytes: [u8; 92]) -> Self[src]

Create a GPTHeader from a raw array.

pub fn read(&mut self, bytes: [u8; 92])[src]

Read the content of a raw array into a GPTHeader.

pub fn write(&self, include_crc: bool) -> [u8; 92][src]

Conver the structure data to a raw array.

pub fn update_header_crc(&mut self)[src]

Update the CRC32 of the header.

Note:

This should be called after having manually update the CRC32 of the partition table.

pub fn is_valid(&self) -> bool[src]

Check if the GPT Header looks valid.

pub fn set_disk_guid(&mut self, uuid: Uuid)[src]

Set the disk GUID.

pub fn get_disk_guid(&self) -> Uuid[src]

Get the disk GUID.

Trait Implementations

impl Clone for GPTHeader[src]

impl Copy for GPTHeader[src]

impl Debug for GPTHeader[src]

impl Default for GPTHeader[src]

impl Eq for GPTHeader[src]

impl PartialEq<GPTHeader> for GPTHeader[src]

impl StructuralEq for GPTHeader[src]

impl StructuralPartialEq for GPTHeader[src]

Auto Trait Implementations

impl RefUnwindSafe for GPTHeader

impl Send for GPTHeader

impl Sync for GPTHeader

impl Unpin for GPTHeader

impl UnwindSafe for GPTHeader

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SizedIPCBuffer for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.