Struct PartitionEntry

Source
pub struct PartitionEntry<'a> { /* private fields */ }
Expand description

Represents a single partition entry.

Implementations§

Source§

impl<'a> PartitionEntry<'a>

Source

pub fn magic(&self) -> u16

The magic value of the entry.

Source

pub fn raw_type(&self) -> u8

The partition type in raw representation.

Source

pub fn raw_subtype(&self) -> u8

The partition sub-type in raw representation.

Source

pub fn offset(&self) -> u32

Offset of the partition on flash.

Source

pub fn len(&self) -> u32

Length of the partition in bytes.

Source

pub fn is_empty(&self) -> bool

Checks for a zero-length partition.

Source

pub fn label(&self) -> &'a [u8]

The label of the partition.

Source

pub fn label_as_str(&self) -> &'a str

The label of the partition as &str.

Source

pub fn flags(&self) -> u32

Raw flags of this partition. You probably want to use Self::is_read_only and Self::is_encrypted instead.

Source

pub fn is_read_only(&self) -> bool

If the partition is read only.

Source

pub fn is_encrypted(&self) -> bool

If the partition is encrypted.

Source

pub fn partition_type(&self) -> PartitionType

The partition type (type and sub-type).

Source

pub fn as_embedded_storage<F>(&'a self, flash: &'a mut F) -> FlashRegion<'a, F>
where F: ReadStorage,

Provides a “view” into the partition allowing to read/write the partition contents by using the given embedded_storage::Storage and/or embedded_storage::ReadStorage implementation.

Trait Implementations§

Source§

impl Debug for PartitionEntry<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Format for PartitionEntry<'_>

Source§

fn format(&self, fmt: Formatter<'_>)

Writes the defmt representation of self to fmt.

Auto Trait Implementations§

§

impl<'a> Freeze for PartitionEntry<'a>

§

impl<'a> RefUnwindSafe for PartitionEntry<'a>

§

impl<'a> Send for PartitionEntry<'a>

§

impl<'a> Sync for PartitionEntry<'a>

§

impl<'a> Unpin for PartitionEntry<'a>

§

impl<'a> UnwindSafe for PartitionEntry<'a>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where 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>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where 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>

Performs the conversion.