Skip to content

Commit 51e59a6

Browse files
committed
Move documentation to the trait methods
1 parent c07e1d7 commit 51e59a6

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

embedded-storage-async/src/nor_flash.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ pub trait AsyncNorFlash: AsyncReadNorFlash {
3131
/// The minumum number of bytes the storage peripheral can erase
3232
const ERASE_SIZE: usize;
3333

34+
type EraseFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
35+
where
36+
Self: 'a;
37+
3438
/// Erase the given storage range, clearing all data within `[from..to]`.
3539
/// The given range will contain all 1s afterwards.
3640
///
@@ -41,11 +45,11 @@ pub trait AsyncNorFlash: AsyncReadNorFlash {
4145
/// Returns an error if the arguments are not aligned or out of bounds (the case where `to >
4246
/// from` is considered out of bounds). The implementation can use the [`check_erase`]
4347
/// helper function.
44-
type EraseFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
45-
where
46-
Self: 'a;
4748
fn erase<'a>(&'a mut self, from: u32, to: u32) -> Self::EraseFuture<'a>;
4849

50+
type WriteFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
51+
where
52+
Self: 'a;
4953
/// If power is lost during write, the contents of the written words are undefined,
5054
/// but the rest of the page is guaranteed to be unchanged.
5155
/// It is not allowed to write to the same word twice.
@@ -54,8 +58,5 @@ pub trait AsyncNorFlash: AsyncReadNorFlash {
5458
///
5559
/// Returns an error if the arguments are not aligned or out of bounds. The implementation
5660
/// can use the [`check_write`] helper function.
57-
type WriteFuture<'a>: Future<Output = Result<(), Self::Error>> + 'a
58-
where
59-
Self: 'a;
6061
fn write<'a>(&'a mut self, offset: u32, bytes: &'a [u8]) -> Self::WriteFuture<'a>;
6162
}

0 commit comments

Comments
 (0)