Embassy Traits
Embassy provides a set of traits and types specifically designed for async
usage. Many of these futures will be upstreamed to the embedded-hal
crate at some point in the future, probably when the required GAT (Generic Associated Types) feature is stabilized in Rust.
-
embassy::io
:AsyncBufRead
,AsyncWrite
. Traits for byte-stream IO, essentiallyno_std
compatible versions offutures::io
. The primary reason for re-defining these traits is that thefutures::io
variant requiresstd::io::Error
, which does not work in theno_std
environment. -
embassy::time
: TimeDriver
trait that is implemented for different platforms. Time in Embassy is represented using theDuration
andInstant
types.
These traits are implemented by the platform-specific crates, such as embassy-nrf
or embassy-stm32
.