File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
embedded-storage-async/src Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 11use core:: future:: Future ;
2- use embedded_storage:: nor_flash:: NorFlashError ;
2+ use embedded_storage:: nor_flash:: ErrorType ;
33
44/// Read only NOR flash trait.
5- pub trait AsyncReadNorFlash {
6- /// Errors returned by this NOR flash.
7- type Error : NorFlashError ;
8-
5+ pub trait AsyncReadNorFlash : ErrorType {
96 /// The minumum number of bytes the storage peripheral can read
107 const READ_SIZE : usize ;
118
Original file line number Diff line number Diff line change @@ -15,6 +15,12 @@ impl NorFlashError for core::convert::Infallible {
1515 }
1616}
1717
18+ /// A trait that NorFlash implementations can use to share an error type.
19+ pub trait ErrorType {
20+ /// Errors returned by this NOR flash.
21+ type Error : NorFlashError ;
22+ }
23+
1824/// NOR flash error kinds.
1925///
2026/// NOR flash implementations must map their error to those generic error kinds through the
@@ -49,10 +55,7 @@ impl core::fmt::Display for NorFlashErrorKind {
4955}
5056
5157/// Read only NOR flash trait.
52- pub trait ReadNorFlash {
53- /// Errors returned by this NOR flash.
54- type Error : NorFlashError ;
55-
58+ pub trait ReadNorFlash : ErrorType {
5659 /// The minumum number of bytes the storage peripheral can read
5760 const READ_SIZE : usize ;
5861
You can’t perform that action at this time.
0 commit comments