Expand description
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.
For examples of how to use and implement the types and traits in this crate see io.rs in the
github.com/rust-bitcoin/rust-bitcoin/bitcoin/examples/ directory.
Re-exports§
pub extern crate hashes;
Structs§
- Cursor
- Wraps an in memory buffer providing
positionfunctionality for read and write. - Error
- The
iocrate error type. - FromStd
- A bridging wrapper providing the I/O traits for types that already implement
stdI/O traits. - Sink
- A sink to which all writes succeed.
- Take
- Reader adapter which limits the bytes read from an underlying reader.
- ToStd
- A bridging wrapper providing the std traits for types that already implement our traits.
Enums§
- Error
Kind - A minimal subset of
std::io::ErrorKindwhich is used forError. - Read
Error - An error that can occur when reading and decoding from a buffered reader.
Traits§
- BufRead
- A trait describing an input stream that uses an internal buffer when reading.
- Read
- A generic trait describing an input stream.
- Write
- A generic trait describing an output stream.
Functions§
- decode_
from_ read - Decodes an object from a buffered reader.
- decode_
from_ read_ unbuffered - Decodes an object from an unbuffered reader using a fixed-size buffer.
- decode_
from_ read_ unbuffered_ with - Decodes an object from an unbuffered reader using a custom-sized buffer.
- encode_
to_ writer - Encodes a consensus_encoding object to an I/O writer.
- from_
std - Wraps a
stdI/O type to implement the traits from this crate. - from_
std_ mut - Wraps a mutable reference to
stdI/O type to implement the traits from this crate. - hash_
reader - Hashes data from a reader.
- sink
- Returns a sink to which all writes succeed.
Type Aliases§
- Result
- Result type returned by functions in this crate.