Function sequential_storage::map::fetch_item
source · pub async fn fetch_item<I: StorageItem, S: NorFlash>(
flash: &mut S,
flash_range: Range<u32>,
cache: impl CacheImpl,
data_buffer: &mut [u8],
search_key: I::Key
) -> Result<Option<I>, MapError<I::Error, S::Error>>Expand description
Get a storage item from the flash. Only the last stored item of the given key is returned.
If no value with the key is found, None is returned.
The data buffer must be long enough to hold the longest serialized data of your StorageItem type, rounded up to flash word alignment.
Note: On a given flash range, make sure to use only the same type as StorageItem every time or types that serialize and deserialize the key in the same way.