Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --features arrayvec,heapless,heapless-09,alloc
- run: cargo test --features arrayvec,heapless,heapless-09,alloc,postcard,shared-ram-ring

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: cargo clippy --features arrayvec,heapless,heapless-09,alloc -- -D warnings
- run: cargo clippy --features arrayvec,heapless,heapless-09,alloc,postcard,shared-ram-ring -- -D warnings

fuzz:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

## Unreleased

## 7.2.0 - 24-03-26

- Added a RAM-buffered queue

## 7.1.0 - 19-01-26

- Added `postcard` feature, disabled by default. This enables the `PostcardValue` trait.
Expand Down
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sequential-storage"
version = "7.1.0"
version = "7.2.0"
edition = "2024"
license = "MIT OR Apache-2.0"
description = "A crate for storing data in flash with minimal erase cycles."
Expand All @@ -22,9 +22,10 @@ heapless = { version = "0.8.0", optional = true }
heapless-09 = { package = "heapless", version = "0.9.0", optional = true }
postcard = { version = "1.1.3", optional = true }
serde = { version = "1.0.228", default-features = false, optional = true }
embassy-sync = { version = "0.6", optional = true }
embassy-sync = { version = "0.8.0", optional = true }

[dev-dependencies]
critical-section = { version = "1", features = ["std"]}
approx = "0.5.1"
futures = { version = "0.3.30", features = ["executor"] }
futures-test = "0.3.30"
Expand Down
3 changes: 2 additions & 1 deletion src/queue/buffer.rs → src/queue/buffered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use crate::{Error, cache::CacheImpl};
///
/// Each item is stored as a 2-byte little-endian length prefix followed by the item's bytes,
/// so the usable capacity for data is `N - 2` bytes per item at most.
pub struct RamRing<const N: usize> {
struct RamRing<const N: usize> {
buf: [u8; N],
read_pos: usize,
write_pos: usize,
Expand All @@ -67,6 +67,7 @@ impl<const N: usize> RamRing<N> {
}

/// Returns `true` if the ring contains no items.
#[allow(unused)]
pub fn is_empty(&self) -> bool {
self.item_count == 0
}
Expand Down
5 changes: 1 addition & 4 deletions src/queue/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
//! Implementation of the queue logic.

pub mod buffer;
#[cfg(feature = "shared-ram-ring")]
pub use buffer::SharedRamRing;
pub use buffer::{BufferedQueue, OverflowPolicy, RamRing};
pub mod buffered;

use crate::item::{Item, ItemHeader, ItemHeaderIter};

Expand Down
Loading