pub struct NVDM { /* private fields */ }Expand description
Represents the Non-Volatile Data Management (NVDM) system, which manages user data storage in flash memory.
NVDM supports data retention after power off and organizes data items into groups, enabling classification and orderly management of items.
Implementations§
Source§impl NVDM
impl NVDM
Sourcepub fn from_peb_size(peb_size: u32) -> Self
pub fn from_peb_size(peb_size: u32) -> Self
Sourcepub fn nvdm_port_get_peb_address(&self, pnum: u32, offset: u32) -> u32
pub fn nvdm_port_get_peb_address(&self, pnum: u32, offset: u32) -> u32
Sourcepub fn get_item(
&self,
group: &str,
name: &str,
status: DataItemStatus,
) -> Option<&DataItem>
pub fn get_item( &self, group: &str, name: &str, status: DataItemStatus, ) -> Option<&DataItem>
Retrieves a reference to a data item matching the specified group, name, and status.
§Parameters
group: The group name to match.name: The item name to match.status: The status of the data item to match.
§Returns
Some(&DataItem)if an item matching all criteria exists.Noneif no matching item is found.
Sourcepub fn get_items_by_group(
&self,
group: &str,
status: DataItemStatus,
) -> Vec<&DataItem>
pub fn get_items_by_group( &self, group: &str, status: DataItemStatus, ) -> Vec<&DataItem>
Sourcepub fn get_groups(&self) -> Vec<&str>
pub fn get_groups(&self) -> Vec<&str>
Returns a list of unique group names present in the stored data items.
§Returns
- A vector of string slices representing distinct group names.
Trait Implementations§
Source§impl FromStream for NVDM
impl FromStream for NVDM
Source§fn read_from<R>(&mut self, reader: &mut R) -> Result<(), Error>
fn read_from<R>(&mut self, reader: &mut R) -> Result<(), Error>
Reads the NVDM data from a binary stream, parsing all physical erase blocks (PEBs) and extracting valid data items.
Iterates through each PEB, checking if it is active, then reads data items within, adding valid items to the internal collection.
§Parameters
reader: A mutable reference to a reader implementingReadandSeek.
§Returns
Ok(())if all data was successfully read.Err(Error)if an I/O or parsing error occurs.
Auto Trait Implementations§
impl Freeze for NVDM
impl RefUnwindSafe for NVDM
impl Send for NVDM
impl Sync for NVDM
impl Unpin for NVDM
impl UnwindSafe for NVDM
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more