pub struct AsyncFlash<F> { /* private fields */ }Available on crate features
async and std only.Expand description
Thin async adapter over any sync flash, implementing the async flash traits.
The wrapped devices here are in-memory, so the “async” operations complete immediately — they delegate straight to the sync implementation. This exists so async code can be exercised without an executor or real hardware.
Page and sector geometry is inherited from the wrapped device, so this
composes with RemovableFlash without restating the constants.
Implementations§
Source§impl<const PAGE_SIZE: usize, const SECTOR_SIZE: usize> AsyncFlash<MockFlash<PAGE_SIZE, SECTOR_SIZE>>
impl<const PAGE_SIZE: usize, const SECTOR_SIZE: usize> AsyncFlash<MockFlash<PAGE_SIZE, SECTOR_SIZE>>
Source§impl<F> AsyncFlash<F>
impl<F> AsyncFlash<F>
Sourcepub fn into_inner(self) -> F
pub fn into_inner(self) -> F
Consume the adapter and return the wrapped device.
Trait Implementations§
Source§impl<F: Clone> Clone for AsyncFlash<F>
impl<F: Clone> Clone for AsyncFlash<F>
Source§impl<F: ErrorType> ErrorType for AsyncFlash<F>
impl<F: ErrorType> ErrorType for AsyncFlash<F>
Source§impl<F: NorFlash> NorFlash for AsyncFlash<F>
impl<F: NorFlash> NorFlash for AsyncFlash<F>
Source§const WRITE_SIZE: usize = F::WRITE_SIZE
const WRITE_SIZE: usize = F::WRITE_SIZE
The minumum number of bytes the storage peripheral can write
Source§const ERASE_SIZE: usize = F::ERASE_SIZE
const ERASE_SIZE: usize = F::ERASE_SIZE
The minumum number of bytes the storage peripheral can erase
Source§impl<F: ReadNorFlash> ReadNorFlash for AsyncFlash<F>
impl<F: ReadNorFlash> ReadNorFlash for AsyncFlash<F>
Source§const READ_SIZE: usize = F::READ_SIZE
const READ_SIZE: usize = F::READ_SIZE
The minumum number of bytes the storage peripheral can read
Source§impl<F: Removable> Removable for AsyncFlash<F>
impl<F: Removable> Removable for AsyncFlash<F>
Source§fn is_present(&self) -> bool
fn is_present(&self) -> bool
Returns
true while the medium is believed present and usable.Auto Trait Implementations§
impl<F> Freeze for AsyncFlash<F>where
F: Freeze,
impl<F> RefUnwindSafe for AsyncFlash<F>where
F: RefUnwindSafe,
impl<F> Send for AsyncFlash<F>where
F: Send,
impl<F> Sync for AsyncFlash<F>where
F: Sync,
impl<F> Unpin for AsyncFlash<F>where
F: Unpin,
impl<F> UnsafeUnpin for AsyncFlash<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for AsyncFlash<F>where
F: UnwindSafe,
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