rust-bitcoin-unsafe-fast/io
Tobin C. Harding f29da57ef6
io: Add functions to read to the end of a reader
The `std::io::Read` trait includes `read_to_end` but that method
provides a denial of service attack vector since an unbounded reader
will exhaust all system memory.

Add a method to our `Read` trait called `read_to_limit` that does the
same as `std::io::Read::read_to_end` but with memory exhaustion
protection.

Add a `read_to_end` method on our `Take` trait and call through to it
from the new method on our `Read` trait called `read_to_limit`.
2024-01-17 11:23:06 +11:00
..
src io: Add functions to read to the end of a reader 2024-01-17 11:23:06 +11:00
Cargo.toml io: Make crate MSRV 1.56.1 2023-12-13 14:22:01 +11:00
README.md io: Simplify crate docs and add README 2024-01-06 08:22:36 +11:00

README.md

Rust-Bitcoin IO Library

The std::io module is not exposed in no-std Rust so building no-std applications which require reading and writing objects via standard traits is not generally possible. Thus, this library exists to export a minmal version of std::io's traits which we use in rust-bitcoin so that we can support no-std applications.

These traits are not one-for-one drop-ins, but are as close as possible while still implementing std::io's traits without unnecessary complexity.