rust-bitcoin-unsafe-fast/io
merge-script 67db64cd97
Merge rust-bitcoin/rust-bitcoin#3885: io: Allow setting position bigger than inner buffer
e315aaf1c6 io: Allow setting position bigger than inner buffer (Tobin C. Harding)

Pull request description:

  Currently if one calls `set_position` on a cursor setting the position greater than the total length of the inner buffer future calls to `Read` will panic. Bad `Cursor` - no biscuit.

  Mirror the stdlib `Cursor` and allow setting the position to any value. Make reads past the end of the buffer return `Ok(0)`.

ACKs for top commit:
  apoelstra:
    ACK e315aaf1c65225b89435d0a60907a3233caa5db1; successfully ran local tests

Tree-SHA512: 71b151218e96343a86c8b2c21c6e8212e2d1c2aea6517b4662da3ad01b3b598cec497028b863a8e36a6b1fae1d4f7f975c8610c3b6f39f1c256adc5751d06ea0
2025-01-10 00:56:43 +00:00
..
contrib CI: Remove shebang from non-executable scripts 2024-05-31 10:10:00 +10:00
src Merge rust-bitcoin/rust-bitcoin#3885: io: Allow setting position bigger than inner buffer 2025-01-10 00:56:43 +00:00
tests units: Refactor Send/Sync api test 2025-01-08 14:52:42 +11:00
CHANGELOG.md Bump version of bitcoin-io to 0.2.0 2024-10-02 09:47:10 +10:00
Cargo.toml Bump version of bitcoin-io to 0.2.0 2024-10-02 09:47:10 +10:00
README.md Change all occurrences of "IO" to "I/O" 2025-01-07 12:37:47 +00:00

README.md

Rust-Bitcoin I/O 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 minimal 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.