Crate bitcoin_io
source ·Expand description
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.
Macros
- Because we cannot provide a blanket implementation of
std::io::Writefor all implementers of this crate’sio::Writetrait, we provide this macro instead.
Structs
- Wraps an in memory reader providing the
positionfunction. - The
iocrate error type. - A sink to which all writes succeed. See
std::io::Sinkfor more info. - Reader adapter which limits the bytes read from an underlying reader.
Enums
- A minimal subset of
std::io::ErrorKindwhich is used forError. Note that, as withstd::io, onlySelf::Interruptedhas defined semantics in this crate, all other variants are provided here only to provide higher-fidelity conversions to and fromstd::io::Error.
Traits
- A trait describing an input stream that uses an internal buffer when reading.
- A generic trait describing an input stream. See
std::io::Readfor more info. - A generic trait describing an output stream. See
std::io::Writefor more info.
Functions
- Returns a sink to which all writes succeed. See
std::io::sinkfor more info.
Type Aliases
- Result type returned by functions in this crate.