Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

embassy-rs/embedded-io

Repository files navigation

⚠️ REPOSITORY ARCHIVED ⚠️

Moved to https://github.com/rust-embedded/embedded-hal

embedded-io

Documentation

IO traits for embedded systems.

Rust's std::io traits are not available in no_std targets, mainly because std::io::Error requires allocation. This crate contains replacement equivalent traits, usable in no_std targets.

The only difference with std::io is Error is an associated type. This allows each implementor to return its own error type, while avoiding dyn or Box. This is how errors are handled in embedded-hal.

Async variations of the traits are also available, returning futures using generic associated types. Note this design is significantly different from both futures::io and tokio::io. The result is much more ergonomic, at the expense of requiring nightly.

License

This work is 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.