pub struct GptPartitionEntryArray<'a> { /* private fields */ }Expand description
Storage for a GPT partition entry array.
Implementations§
Source§impl<'a> GptPartitionEntryArray<'a>
impl<'a> GptPartitionEntryArray<'a>
Sourcepub fn new(
layout: GptPartitionEntryArrayLayout,
block_size: BlockSize,
storage: &'a mut [u8],
) -> Result<Self, GptPartitionEntryArrayError>
pub fn new( layout: GptPartitionEntryArrayLayout, block_size: BlockSize, storage: &'a mut [u8], ) -> Result<Self, GptPartitionEntryArrayError>
Create a new GptPartitionEntryArray with the given
layout. The length of storage must be at least
layout.num_bytes_rounded_to_block.
Sourcepub fn storage_mut(&mut self) -> &mut [u8]
pub fn storage_mut(&mut self) -> &mut [u8]
Get a mutable reference to the storage buffer.
Sourcepub fn layout(&self) -> &GptPartitionEntryArrayLayout
pub fn layout(&self) -> &GptPartitionEntryArrayLayout
Get the partition entry array layout.
Sourcepub fn set_start_lba(&mut self, start_lba: Lba)
pub fn set_start_lba(&mut self, start_lba: Lba)
Change the partition entry array’s start Lba.
Sourcepub fn get_partition_entry(&self, index: u32) -> Option<&GptPartitionEntry>
Available on crate feature bytemuck only.
pub fn get_partition_entry(&self, index: u32) -> Option<&GptPartitionEntry>
bytemuck only.Get a partition entry reference. The index is zero-based.
Sourcepub fn get_partition_entry_mut(
&mut self,
index: u32,
) -> Option<&mut GptPartitionEntry>
Available on crate feature bytemuck only.
pub fn get_partition_entry_mut( &mut self, index: u32, ) -> Option<&mut GptPartitionEntry>
bytemuck only.Get a mutable partition entry reference. The index is zero-based.
Sourcepub fn calculate_crc32(&self) -> Crc32
pub fn calculate_crc32(&self) -> Crc32
Calculate the CRC32 checksum for the partition entry array. The
return value can then be set in the
GptHeader::partition_entry_array_crc32 field.
Auto Trait Implementations§
impl<'a> Freeze for GptPartitionEntryArray<'a>
impl<'a> RefUnwindSafe for GptPartitionEntryArray<'a>
impl<'a> Send for GptPartitionEntryArray<'a>
impl<'a> Sync for GptPartitionEntryArray<'a>
impl<'a> Unpin for GptPartitionEntryArray<'a>
impl<'a> !UnwindSafe for GptPartitionEntryArray<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more