Crate binary_sv2

Source
Expand description

Mediates between two implementations of the binary_sv2 protocol, enabling encoding and decoding through serde or custom traits.

§Overview

Depending on the feature flags enabled, this crate will re-export implementations of the Deserialize and Serialize traits either from the serde library or from a custom, serde-free implementation provided by binary_codec_sv2 and derive_codec_sv2. This allows for flexible integration of SV2 protocol types and binary serialization for environments that may not support serde.

§Features

  • with_serde: Enables serde-based serialization and deserialization for SV2 types, using serde and serde_sv2.
  • core: Enables the custom binary_codec_sv2 and derive_codec_sv2 implementations, which provide Deserialize and Serialize traits without the need for serde.
  • prop_test: Adds support for property testing for protocol types.
  • with_buffer_pool: Enables support for buffer pooling to optimize memory usage during serialization and deserialization.

Re-exports§

pub use serde;

Modules§

binary_codec_sv2

Structs§

B016M
B0255
B032
B064K
Bytes
Deserializer
Seq0255
Seq064K
Serializer
ShortTxId
Signature
Sv2Option
U24
U256

Enums§

Error

Traits§

Deserialize
A data structure that can be deserialized from any data format supported by Serde.
GetSize
Serialize
A data structure that can be serialized into any data format supported by Serde.

Functions§

clone_message
Does nothing and will be removed during refactor
from_bytes
to_bytes
to_writer
u256_from_int
Converts a value implementing the Into<u64> trait into a custom U256 type.

Type Aliases§

Bool
Pubkey
Result
Str0255
U8
U16
U32
U64

Derive Macros§

Deserialize
Serialize