Expand description
Export custom implementations of the binary_sv2
protocol,
enabling encoding and decoding through custom traits.
§Overview
This crate will re-export implementations of theDeserialize
and Serialize
traits
from a custom implementation provided by binary_codec_sv2
and derive_codec_sv2
.
This allows for flexible integration of SV2 protocol types and binary serialization.
§Features
- 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 binary_codec_sv2;
Modules§
Structs§
- CVec
- CVec2
- Seq0255
- The liftime is here only for type compatibility with serde-sv2
- Seq064K
- The liftime is here only for type compatibility with serde-sv2
- Sv2Option
- The liftime is here only for type compatibility with serde-sv2
- U24
Enums§
- CError
- FFI-safe Error
- Encodable
Field - Error
Traits§
- Decodable
- Implmented by all the decodable structure, it can be derived for every structure composed only by primitives or other Decodable.
- Deserialize
- Implmented by all the decodable structure, it can be derived for every structure composed only by primitives or other Decodable.
- Encodable
- Fixed
- Implemented by all the primitives with a fixed size
- GetMarker
- GetSize
- Return the encoded byte size of an
Encodable
comprehensive of the header, if any - Serialize
- Size
Hint - Return the encoded byte size or a
Decodable
- Sv2Data
Type
Functions§
- _c_
export_ cvec - _c_
export_ cvec2 - _c_
export_ u24 - clone_
message - Does nothing and will be removed during refactor
- cvec2_
push ⚠ - The caller is reponsible for NOT adding duplicate cvecs to the cvec2 structure, as this can lead to double free errors when the message is dropped.
- cvec_
from_ ⚠buffer - Given a C allocated buffer return a rust allocated CVec
- free_
vec - free_
vec_ 2 - from_
bytes - init_
cvec2 ⚠ - Safety
- to_
bytes - to_
writer - u256_
from_ int - Converts a value implementing the
Into<u64>
trait into a customU256
type.
Type Aliases§
Derive Macros§
- Deserialize
- Derives the
Decodable
trait, generating implementations for deserializing a struct from a byte stream, including its structure, field decoding, and a method for creating a static version. - Serialize
- Derives the
Encodable
trait, generating implementations for serializing a struct into an encoded format, including methods for field serialization, calculating the encoded size, and handling cases where the struct is already sized.