#embedded-io #adapter #traits #io-stream #converting #structs #layer

no-std dev embedded-io-adapters

Adapters between the embedded-io traits and other I/O traits

4 releases (2 breaking)

0.6.1 Nov 29, 2023
0.6.0 Oct 3, 2023
0.5.0 Aug 7, 2023
0.0.0 Jul 17, 2023

#1911 in Embedded development

Download history 24/week @ 2024-01-01 105/week @ 2024-01-08 95/week @ 2024-01-15 26/week @ 2024-01-22 68/week @ 2024-01-29 89/week @ 2024-02-05 122/week @ 2024-02-12 115/week @ 2024-02-19 130/week @ 2024-02-26 96/week @ 2024-03-04 129/week @ 2024-03-11 104/week @ 2024-03-18 95/week @ 2024-03-25 151/week @ 2024-04-01 97/week @ 2024-04-08 147/week @ 2024-04-15

498 downloads per month
Used in 9 crates

MIT/Apache

51KB
769 lines

crates.io crates.io Documentation

embedded-io-adapters

This project is developed and maintained by the HAL team.

Adapters between the embedded-io and embedded-io-async traits and other IO traits.

The adapters are structs that wrap an I/O stream and implement another family of I/O traits based on the wrapped streams. This allows "converting" from an embedded_io::Read to a std::io::Read or vice versa, for example.

There are no separate adapters for Read/ReadBuf/Write traits. Instead, a single adapter implements the right traits based on what the inner type implements. This allows using these adapters when using combinations of traits, like Read+Write.

Supported traits

For embedded-io:

  • std::io traits. Needs the std feature.

For embedded-io-async:

Minimum Supported Rust Version (MSRV)

This crate is guaranteed to compile on stable Rust 1.60 and up. It might compile with older versions but that may change in any new patch release.

See here for details on how the MSRV may be upgraded.

Enabling any of the tokio-* or futures-* Cargo features requires Rust nightly newer than nightly-2022-11-22, due to requiring support for async fn in traits (AFIT), which is not stable yet. Keep in mind Rust nightlies can make backwards-incompatible changes to unstable features at any time.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0–1.3MB
~22K SLoC