Expand description
§Rust Bitcoin - consensus encoding and decoding
This library provides traits that can be used to encode/decode objects in a consensus-consistent way.
Macros§
- encoder_
newtype - Implements a newtype around an encoder which implements the
Encodertrait by forwarding to the wrapped encoder.
Structs§
- Array
Decoder - A decoder that expects exactly N bytes and returns them as an array.
- Array
Encoder - An encoder for a single array.
- Byte
VecDecoder - A decoder that decodes a byte vector.
- Byte
VecDecoder Error - The error returned by the
ByteVecDecoder. - Bytes
Encoder - An encoder for a single byte slice.
- Compact
Size Decoder - Decodes a compact size encoded integer.
- Compact
Size Decoder Error - An error consensus decoding a compact size encoded integer.
- Compact
Size Encoder - Encoder for a compact size encoded integer.
- Decoder2
- A decoder which wraps two inner decoders and returns the output of both.
- Decoder3
- A decoder which decodes three objects, one after the other.
- Decoder4
- A decoder which decodes four objects, one after the other.
- Decoder6
- A decoder which decodes six objects, one after the other.
- Encoder2
- An encoder which encodes two objects, one after the other.
- Encoder3
- An encoder which encodes three objects, one after the other.
- Encoder4
- An encoder which encodes four objects, one after the other.
- Encoder6
- An encoder which encodes six objects, one after the other.
- Length
Prefix Exceeds MaxError - Length prefix exceeds max value (4,000,000).
- Slice
Encoder - An encoder for a list of encodable types.
- Unexpected
EofError - Not enough bytes given to decoder.
- VecDecoder
- A decoder that decodes a vector of
Ts. - VecDecoder
Error - The error returned by the
VecDecoder.
Enums§
- Decoder2
Error - Error type for
Decoder2. - Decoder3
Error - Error type for
Decoder3. - Decoder4
Error - Error type for
Decoder4. - Decoder6
Error - Error type for
Decoder6. - Read
Error - An error that can occur when reading and decoding from a buffered reader.
Traits§
- Decodable
- A Bitcoin object which can be consensus-decoded using a push decoder.
- Decoder
- A push decoder for a consensus-decodable object.
- Encodable
- A Bitcoin object which can be consensus-encoded.
- Encoder
- An encoder for a consensus-encodable object.
Functions§
- cast_
to_ usize_ if_ valid - Cast a decoded length prefix to a
usize. - 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.
- decode_
from_ slice - Decodes an object from a byte slice.
- encode_
to_ vec - Encodes an object into a vector.
- encode_
to_ writer - Encodes an object to a standard I/O writer.