pub struct GptPartitionEntryArrayLayout {
pub start_lba: Lba,
pub entry_size: GptPartitionEntrySize,
pub num_entries: u32,
}Expand description
Disk layout of a GPT partition entry array.
Fields§
§start_lba: LbaFirst block of the array.
entry_size: GptPartitionEntrySizeSize in bytes of each entry.
num_entries: u32Number of entries in the array.
Implementations§
Source§impl GptPartitionEntryArrayLayout
impl GptPartitionEntryArrayLayout
Sourcepub fn num_blocks(&self, block_size: BlockSize) -> Option<u64>
pub fn num_blocks(&self, block_size: BlockSize) -> Option<u64>
Get the number of blocks needed for this layout. Returns None
if overflow occurs.
Sourcepub fn num_blocks_as_usize(&self, block_size: BlockSize) -> Option<usize>
pub fn num_blocks_as_usize(&self, block_size: BlockSize) -> Option<usize>
Get the number of blocks needed for this layout. Returns None
if overflow occurs.
Sourcepub fn num_bytes_exact(&self) -> Option<u64>
pub fn num_bytes_exact(&self) -> Option<u64>
Get the number of bytes needed for the entries in this layout,
ignoring any padding needed at the end to match the block
size. This corresponds to the number of bytes that are covered
by the partition_entry_array_crc32.
Returns None if overflow occurs.
Sourcepub fn num_bytes_exact_as_usize(&self) -> Option<usize>
pub fn num_bytes_exact_as_usize(&self) -> Option<usize>
Get the number of bytes needed for the entries in this layout,
ignoring any padding needed at the end to match the block
size. This corresponds to the number of bytes that are covered
by the partition_entry_array_crc32.
Returns None if overflow occurs.
Sourcepub fn num_bytes_rounded_to_block(&self, block_size: BlockSize) -> Option<u64>
pub fn num_bytes_rounded_to_block(&self, block_size: BlockSize) -> Option<u64>
Get the number of bytes needed for this layout, rounded up to
the nearest block. This is equivalent to num_blocks *
block_size.
Returns None if overflow occurs.
Sourcepub fn num_bytes_rounded_to_block_as_usize(
&self,
block_size: BlockSize,
) -> Option<usize>
pub fn num_bytes_rounded_to_block_as_usize( &self, block_size: BlockSize, ) -> Option<usize>
Get the number of bytes needed for this layout, rounded up to
the nearest block. This is equivalent to num_blocks *
block_size.
Returns None if overflow occurs.
Trait Implementations§
Source§impl Clone for GptPartitionEntryArrayLayout
impl Clone for GptPartitionEntryArrayLayout
Source§fn clone(&self) -> GptPartitionEntryArrayLayout
fn clone(&self) -> GptPartitionEntryArrayLayout
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GptPartitionEntryArrayLayout
impl Debug for GptPartitionEntryArrayLayout
Source§impl Default for GptPartitionEntryArrayLayout
impl Default for GptPartitionEntryArrayLayout
Source§fn default() -> GptPartitionEntryArrayLayout
fn default() -> GptPartitionEntryArrayLayout
Source§impl Hash for GptPartitionEntryArrayLayout
impl Hash for GptPartitionEntryArrayLayout
Source§impl Ord for GptPartitionEntryArrayLayout
impl Ord for GptPartitionEntryArrayLayout
Source§fn cmp(&self, other: &GptPartitionEntryArrayLayout) -> Ordering
fn cmp(&self, other: &GptPartitionEntryArrayLayout) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for GptPartitionEntryArrayLayout
impl PartialEq for GptPartitionEntryArrayLayout
Source§fn eq(&self, other: &GptPartitionEntryArrayLayout) -> bool
fn eq(&self, other: &GptPartitionEntryArrayLayout) -> bool
self and other values to be equal, and is used by ==.