formats
formats copied to clipboard
tls_codec: `no_std` support
Allow building tls-codec with no_std
.
I now see this is a bit more
std
-dependent than I realized due to the extensive use ofstd::io::{Read, Write}
.
Originally posted by @tarcieri in https://github.com/RustCrypto/formats/pull/56#pullrequestreview-764378515
I did an initial pass on this in #291. However as I noted on that PR:
Unfortunately all serialization/deserialization is currently performed in terms of the
Read
andWrite
traits fromstd::io
, so this doesn't result in something immediately useful onno_std
targets. However, it does provide the initial boilerplate and first steps towards making that possible.The next steps I'd suggest after this would be defining replacement traits for
std::io::{Read, Write}
which provide the subset of functionality currently used by this crate, so that they can always be available regardless of whether or not thestd
feature is enabled.When the
std
feature is enabled, blanket impls of these traits can be defined for the correspondingstd::io
traits, so everything continues to work with them.
I think we can close this as having initial no_std
support in place