@@ -31,6 +31,10 @@ pub trait AsyncNorFlash: AsyncReadNorFlash {
31
31
/// The minumum number of bytes the storage peripheral can erase
32
32
const ERASE_SIZE : usize ;
33
33
34
+ type EraseFuture < ' a > : Future < Output = Result < ( ) , Self :: Error > > + ' a
35
+ where
36
+ Self : ' a ;
37
+
34
38
/// Erase the given storage range, clearing all data within `[from..to]`.
35
39
/// The given range will contain all 1s afterwards.
36
40
///
@@ -41,11 +45,11 @@ pub trait AsyncNorFlash: AsyncReadNorFlash {
41
45
/// Returns an error if the arguments are not aligned or out of bounds (the case where `to >
42
46
/// from` is considered out of bounds). The implementation can use the [`check_erase`]
43
47
/// helper function.
44
- type EraseFuture < ' a > : Future < Output = Result < ( ) , Self :: Error > > + ' a
45
- where
46
- Self : ' a ;
47
48
fn erase < ' a > ( & ' a mut self , from : u32 , to : u32 ) -> Self :: EraseFuture < ' a > ;
48
49
50
+ type WriteFuture < ' a > : Future < Output = Result < ( ) , Self :: Error > > + ' a
51
+ where
52
+ Self : ' a ;
49
53
/// If power is lost during write, the contents of the written words are undefined,
50
54
/// but the rest of the page is guaranteed to be unchanged.
51
55
/// It is not allowed to write to the same word twice.
@@ -54,8 +58,5 @@ pub trait AsyncNorFlash: AsyncReadNorFlash {
54
58
///
55
59
/// Returns an error if the arguments are not aligned or out of bounds. The implementation
56
60
/// can use the [`check_write`] helper function.
57
- type WriteFuture < ' a > : Future < Output = Result < ( ) , Self :: Error > > + ' a
58
- where
59
- Self : ' a ;
60
61
fn write < ' a > ( & ' a mut self , offset : u32 , bytes : & ' a [ u8 ] ) -> Self :: WriteFuture < ' a > ;
61
62
}
0 commit comments