embassy_embedded_hal/flash/partition/
mod.rs1use embedded_storage::nor_flash::{NorFlashError, NorFlashErrorKind};
4
5mod asynch;
6mod blocking;
7
8pub use asynch::Partition;
9pub use blocking::BlockingPartition;
10
11#[derive(Debug, PartialEq, Eq)]
13#[cfg_attr(feature = "defmt", derive(defmt::Format))]
14pub enum Error<T> {
15 OutOfBounds,
17 Flash(T),
19}
20
21impl<T: NorFlashError> NorFlashError for Error<T> {
22 fn kind(&self) -> NorFlashErrorKind {
23 match self {
24 Error::OutOfBounds => NorFlashErrorKind::OutOfBounds,
25 Error::Flash(f) => f.kind(),
26 }
27 }
28}