[−][src]Struct gptman::GPTHeader
A GUID Partition Table header as describe on Wikipedia's page.
Fields
signature: [u8; 8]
GPT signature (must be "EFI PART").
revision: [u8; 4]
GPT revision (must be 00 00 01 00).
header_size: u32
GPT header size (must be 92).
crc32_checksum: u32
CRC32 checksum of the header.
reserved: [u8; 4]
Reserved bytes of the header.
primary_lba: u64
Location (in sectors) of the primary header.
backup_lba: u64
Location (in sectors) of the backup header.
first_usable_lba: u64
Location (in sectors) of the first usable sector.
last_usable_lba: u64
Location (in sectors) of the last usable sector.
disk_guid: [u8; 16]
16 bytes representing the UUID of the GPT.
partition_entry_lba: u64
Location (in sectors) of the partition entries array.
number_of_partition_entries: u32
Number of partition entries in the array.
size_of_partition_entry: u32
Size (in bytes) of a partition entry.
partition_entry_array_crc32: u32
CRC32 checksum of the partition array.
Methods
impl GPTHeader
[src]
pub fn new_from<R>(
reader: &mut R,
sector_size: u64,
disk_guid: [u8; 16]
) -> Result<GPTHeader> where
R: Read + Seek,
[src]
reader: &mut R,
sector_size: u64,
disk_guid: [u8; 16]
) -> Result<GPTHeader> where
R: Read + Seek,
Make a new GPT header based on a reader. (This operation does not write anything to disk!)
pub fn read_from<R: ?Sized>(reader: &mut R) -> Result<GPTHeader> where
R: Read + Seek,
[src]
R: Read + Seek,
Attempt to read a GPT header from a reader.
pub fn write_into<W: ?Sized>(
&mut self,
writer: &mut W,
sector_size: u64,
partitions: &[GPTPartitionEntry]
) -> Result<()> where
W: Write + Seek,
[src]
&mut self,
writer: &mut W,
sector_size: u64,
partitions: &[GPTPartitionEntry]
) -> Result<()> where
W: Write + Seek,
Write the GPT header into a writer. This operation will update the CRC32 checksums of the current struct and seek at the correct location before trying to write to disk.
pub fn generate_crc32_checksum(&self) -> u32
[src]
Generate the CRC32 checksum of the partition header only.
pub fn update_crc32_checksum(&mut self)
[src]
Update the CRC32 checksum of this header.
pub fn generate_partition_entry_array_crc32(
&self,
partitions: &[GPTPartitionEntry]
) -> u32
[src]
&self,
partitions: &[GPTPartitionEntry]
) -> u32
Generate the CRC32 checksum of the partition entry array.
pub fn update_partition_entry_array_crc32(
&mut self,
partitions: &[GPTPartitionEntry]
)
[src]
&mut self,
partitions: &[GPTPartitionEntry]
)
Update the CRC32 checksum of the partition entry array.
pub fn update_from<S: ?Sized>(
&mut self,
seeker: &mut S,
sector_size: u64
) -> Result<()> where
S: Seek,
[src]
&mut self,
seeker: &mut S,
sector_size: u64
) -> Result<()> where
S: Seek,
Updates the header to match the specifications of the reader given in argument.
first_usable_lba
, last_usable_lba
, primary_lba
, backup_lba
will be updated after
this operation.
Trait Implementations
impl Clone for GPTHeader
[src]
fn clone(&self) -> GPTHeader
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for GPTHeader
[src]
impl Serialize for GPTHeader
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for GPTHeader
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Unpin for GPTHeader
impl Sync for GPTHeader
impl Send for GPTHeader
impl RefUnwindSafe for GPTHeader
impl UnwindSafe for GPTHeader
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,