Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support peek_many and pop_many #12

Merged
merged 10 commits into from
Dec 16, 2023
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Dion Dokter <diondokter@gmail.com>
  • Loading branch information
lulf and diondokter authored Dec 15, 2023
commit a662b88a3b2aead4a893e17e2838ea0dc5d79362
10 changes: 5 additions & 5 deletions src/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ pub struct PopIterator<'d, S: MultiwriteNorFlash> {
}

impl<'d, S: MultiwriteNorFlash> PopIterator<'d, S> {
/// Pop the next event.
/// Pop the next data.
///
/// The data is written to the given `data_buffer`` and the part that was written is returned.
/// The data is written to the given `data_buffer` and the part that was written is returned.
/// It is valid to only use the length of the returned slice and use the original `data_buffer`.
/// The `data_buffer` may contain extra data on ranges after the returned slice.
/// You should not depend on that data.
Expand Down Expand Up @@ -261,9 +261,9 @@ pub struct PeekIterator<'d, S: NorFlash> {
}

impl<'d, S: NorFlash> PeekIterator<'d, S> {
/// Peek at the next event.
/// Peek at the next data.
///
/// The data is written to the given `data_buffer`` and the part that was written is returned.
/// The data is written to the given `data_buffer` and the part that was written is returned.
/// It is valid to only use the length of the returned slice and use the original `data_buffer`.
/// The `data_buffer` may contain extra data on ranges after the returned slice.
/// You should not depend on that data.
Expand All @@ -281,7 +281,7 @@ impl<'d, S: NorFlash> PeekIterator<'d, S> {
}

/// An iterator-like interface for peeking into events stored in flash.
pub struct QueueIterator<'d, S: NorFlash> {
struct QueueIterator<'d, S: NorFlash> {
flash: &'d mut S,
flash_range: Range<u32>,
oldest_page: Option<usize>,
Expand Down