Function remove_item

Source
pub async fn remove_item<K: Key, S: MultiwriteNorFlash>(
    flash: &mut S,
    flash_range: Range<u32>,
    cache: &mut impl KeyCacheImpl<K>,
    data_buffer: &mut [u8],
    search_key: &K,
) -> Result<(), Error<S::Error>>
Expand description

Fully remove an item. Additional calls to fetch with the same key will return None until a new one is stored again.

This is really slow!

All items in flash have to be read and deserialized to find the items with the key. This is unlikely to be cached well.

Alternatively, e.g. when you don’t have a MultiwriteNorFlash flash, you could store your value inside an Option and store the value None to mark it as erased.

You are required to, on a given flash range, use the same Key type every time. You are allowed to use multiple Value types. See the module-level docs for more information about this.

Also watch out for using integers. This function will take any integer and it’s easy to pass the wrong type.