formats icon indicating copy to clipboard operation
formats copied to clipboard

tls_codec: `no_std` support

Open franziskuskiefer opened this issue 3 years ago • 1 comments

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 of std::io::{Read, Write}.

Originally posted by @tarcieri in https://github.com/RustCrypto/formats/pull/56#pullrequestreview-764378515

franziskuskiefer avatar Sep 30 '21 11:09 franziskuskiefer

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 and Write traits from std::io, so this doesn't result in something immediately useful on no_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 the std feature is enabled.

When the std feature is enabled, blanket impls of these traits can be defined for the corresponding std::io traits, so everything continues to work with them.

tarcieri avatar Mar 25 '22 14:03 tarcieri

I think we can close this as having initial no_std support in place

tarcieri avatar Aug 18 '24 14:08 tarcieri