Crates.io | embedded-io-adapters |
lib.rs | embedded-io-adapters |
version | 0.6.1 |
source | src |
created_at | 2023-07-17 16:28:36.590068 |
updated_at | 2023-11-29 14:03:00.625147 |
description | Adapters between the `embedded-io` traits and other I/O traits |
homepage | |
repository | https://github.com/rust-embedded/embedded-hal |
max_upload_size | |
id | 918655 |
size | 28,754 |
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
.
For embedded-io
:
std::io
traits. Needs the std
feature.For embedded-io-async
:
futures
0.3 traits. Needs the futures-03
feature.tokio
1.x traits. Needs the tokio-1
feature.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.
Licensed under either of
at your option.
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.