pub struct PartitionEntry { /* private fields */ }Expand description
Represents a single partition entry.
Implementations§
Source§impl PartitionEntry
impl PartitionEntry
Sourcepub fn raw_subtype(&self) -> u8
pub fn raw_subtype(&self) -> u8
The partition sub-type in raw representation.
Sourcepub fn label_as_str(&self) -> &str
pub fn label_as_str(&self) -> &str
The label of the partition as &str.
Sourcepub fn flags(&self) -> u32
pub fn flags(&self) -> u32
Raw flags of this partition. You probably want to use Self::is_read_only and Self::is_encrypted instead.
Sourcepub fn is_read_only(&self) -> bool
pub fn is_read_only(&self) -> bool
If the partition is read only.
Sourcepub fn is_encrypted(&self) -> bool
pub fn is_encrypted(&self) -> bool
If the partition is encrypted.
This is the flag from the partition table. If flash encryption is enabled certain partition types are encrypted regardless of this.
Sourcepub fn partition_type(&self) -> PartitionType
pub fn partition_type(&self) -> PartitionType
The partition type (type and sub-type).
Sourcepub fn as_flash_region<'a, 'd>(
self,
flash: &'a mut FlashStorage<'d>,
) -> FlashRegion<'a, 'd>
pub fn as_flash_region<'a, 'd>( self, flash: &'a mut FlashStorage<'d>, ) -> FlashRegion<'a, 'd>
Provides a “view” into the partition allowing to read/write the
partition contents using the given FlashStorage.
Sourcepub fn sha256(&self, flash: &mut FlashStorage<'_>) -> Result<[u8; 32], Error>
pub fn sha256(&self, flash: &mut FlashStorage<'_>) -> Result<[u8; 32], Error>
Calculate the SHA-256 digest of this partition.
- App / bootloader with appended hash: return that digest after verifying it
- App / bootloader without appended hash: hash the image (not the whole partition)
- Other types: hash the entire partition
For app images this is the validation hash (shown by
esptool.py image-info), not the ELF file SHA-256 stored in
crate::EspAppDesc.
Trait Implementations§
Source§impl Clone for PartitionEntry
impl Clone for PartitionEntry
Source§fn clone(&self) -> PartitionEntry
fn clone(&self) -> PartitionEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable)§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PartitionEntry
Source§impl Debug for PartitionEntry
impl Debug for PartitionEntry
Auto Trait Implementations§
impl Freeze for PartitionEntry
impl RefUnwindSafe for PartitionEntry
impl Send for PartitionEntry
impl Sync for PartitionEntry
impl Unpin for PartitionEntry
impl UnsafeUnpin for PartitionEntry
impl UnwindSafe for PartitionEntry
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)