Skip to content

Commit 198b73b

Browse files
committed
Add Cursor type
This is a no_std variant of `std::io::Cursor`. Fixes #631. The implementation was generated by an LLM by copying the std impl and adapting it. I (Zeeshan) reviewed the code and adjusted small bits. The tests added are further guarantee that the code is doing what it's supposed to do.
1 parent e6b10a6 commit 198b73b

4 files changed

Lines changed: 720 additions & 2 deletions

File tree

embedded-io-adapters/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
- Add `Cursor` type, an `embedded-io` equivalent of `std::io::Cursor`.
11+
- Add `alloc` and `defmt` Cargo features.
12+
813
## 0.7.0 - 2025-09-30
914

1015
- Update to embedded-io and embedded-io-async 0.7

embedded-io-adapters/Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,20 @@ categories = [
1313
]
1414

1515
[features]
16-
std = ["embedded-io/std"]
16+
std = ["alloc", "embedded-io/std"]
17+
alloc = ["embedded-io/alloc"]
18+
defmt = ["dep:defmt", "embedded-io/defmt"]
1719
tokio-1 = ["std", "dep:tokio", "dep:embedded-io-async", "embedded-io-async?/std"]
1820
futures-03 = ["std", "dep:futures", "dep:embedded-io-async", "embedded-io-async?/std"]
1921

2022
[dependencies]
2123
embedded-io = { version = "0.7", path = "../embedded-io" }
2224
embedded-io-async = { version = "0.7", path = "../embedded-io-async", optional = true }
2325

26+
defmt = { version = "1", optional = true }
2427
futures = { version = "0.3.21", features = ["std"], default-features = false, optional = true }
2528
tokio = { version = "1", features = ["io-util"], default-features = false, optional = true }
2629

2730
[package.metadata.docs.rs]
28-
features = ["std", "tokio-1", "futures-03"]
31+
features = ["std", "defmt", "tokio-1", "futures-03"]
2932
rustdoc-args = ["--cfg", "docsrs"]

0 commit comments

Comments
 (0)