pub trait MerkleProofSerializer {
// Required methods
fn serialize<T: Hasher>(proof: &MerkleProof<T>) -> Vec<u8> ⓘ;
fn deserialize<T: Hasher>(bytes: &[u8]) -> Result<MerkleProof<T>, Error>;
}
Expand description
Trait representing a Merkle proof serializer. Used in MerkleProof::serialize
and
MerkleProof::deserialize
.
The library provides some built-in implementations of this trait - check
proof_serializers
module.
Required Methods§
sourcefn serialize<T: Hasher>(proof: &MerkleProof<T>) -> Vec<u8> ⓘ
fn serialize<T: Hasher>(proof: &MerkleProof<T>) -> Vec<u8> ⓘ
Serialize data from MerkleProof
into a binary
sourcefn deserialize<T: Hasher>(bytes: &[u8]) -> Result<MerkleProof<T>, Error>
fn deserialize<T: Hasher>(bytes: &[u8]) -> Result<MerkleProof<T>, Error>
Deserialize data produced by MerkleProofSerializer::serialize
back into MerkleProof
Object Safety§
This trait is not object safe.