core+ (or coreplus on crates.io
) contains types and traits that make it possible to write libraries that are completely generic on the network and I/O stack available on no_std
.
Aside from a number of networking types (IpAddr
, SocketAddr
, Ipv4Addr
, etc), core+ contains 6 traits that are extremely important for I/O:
All these traits have Error
associated types.
There's a lack of standardization around I/O traits on no_std, so I wrote core+
to fix that.
Reasoning
Part of the work that I've been doing for Golioth, my employer for this summer, is writing a Rust client for Golioth that can run on embedded devices. Since it needs internet connectivity, there have been complications about making it generic on the network stack it has access to. embedded-nal
is a step in the right direction, but it doesn't expose Read, Write, and their async counterparts, which is the really important part in my opinion.
futures-io
exposes AsyncRead
and AsyncWrite
traits, but only when the standard library is available. Read
and Write
are exposed for no_std
in a couple of different crates, but I think the version in core+
is the most flexible one I've seen.