Trait zebra_chain::serialization::ZcashDeserialize
source · pub trait ZcashDeserialize: Sized {
// Required method
fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>;
}
Expand description
Consensus-critical deserialization for Zcash.
This trait provides a generic deserialization for consensus-critical formats, such as network messages, transactions, blocks, etc.
It is intended for use only for consensus-critical formats.
Internal deserialization can freely use serde
, or any other format.
Required Methods§
sourcefn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
Try to read self
from the given reader
.
This function has a zcash_
prefix to alert the reader that the
serialization in use is consensus-critical serialization, rather than
some other kind of serialization.
Object Safety§
Implementations on Foreign Types§
source§impl ZcashDeserialize for Option<ShieldedData>
impl ZcashDeserialize for Option<ShieldedData>
fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
source§impl ZcashDeserialize for String
impl ZcashDeserialize for String
Read a Bitcoin-encoded UTF-8 string.
fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
source§impl ZcashDeserialize for Vec<u8>
impl ZcashDeserialize for Vec<u8>
Implement ZcashDeserialize for Vec<u8>
directly instead of using the blanket Vec implementation
This allows us to optimize the inner loop into a single call to read_exact()
Note that we don’t implement TrustedPreallocate for u8.
This allows the optimization without relying on specialization.
fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
source§impl ZcashDeserialize for Ipv6Addr
impl ZcashDeserialize for Ipv6Addr
Read a Bitcoin-encoded IPv6 address.
fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
source§impl ZcashDeserialize for Base
impl ZcashDeserialize for Base
fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
source§impl ZcashDeserialize for Fq
impl ZcashDeserialize for Fq
fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
source§impl ZcashDeserialize for PublicKey
impl ZcashDeserialize for PublicKey
fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
source§impl ZcashDeserialize for Scalar
impl ZcashDeserialize for Scalar
fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
source§impl ZcashDeserialize for Signature<SpendAuth>
impl ZcashDeserialize for Signature<SpendAuth>
fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
source§impl<P> ZcashDeserialize for Option<JoinSplitData<P>>
impl<P> ZcashDeserialize for Option<JoinSplitData<P>>
fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
source§impl<T> ZcashDeserialize for Arc<T>where
T: ZcashDeserialize,
impl<T> ZcashDeserialize for Arc<T>where
T: ZcashDeserialize,
fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
source§impl<T: ZcashDeserialize + TrustedPreallocate> ZcashDeserialize for Vec<T>
impl<T: ZcashDeserialize + TrustedPreallocate> ZcashDeserialize for Vec<T>
Deserialize a Vec
, where the number of items is set by a CompactSize
prefix in the data. This is the most common format in Zcash.
See zcash_deserialize_external_count
for more details, and usage
information.
fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
source§impl<T: SigType> ZcashDeserialize for Signature<T>
impl<T: SigType> ZcashDeserialize for Signature<T>
fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>
Implementors§
impl ZcashDeserialize for Transaction
impl ZcashDeserialize for LockTime
impl ZcashDeserialize for Address
impl ZcashDeserialize for Input
impl ZcashDeserialize for Solution
impl ZcashDeserialize for Amount<NegativeAllowed>
impl ZcashDeserialize for Amount<NonNegative>
impl ZcashDeserialize for zebra_chain::block::hash::Hash
impl ZcashDeserialize for CountedHeader
impl ZcashDeserialize for Header
impl ZcashDeserialize for Block
impl ZcashDeserialize for Action
impl ZcashDeserialize for ValueCommitment
impl ZcashDeserialize for zebra_chain::orchard::keys::EphemeralPublicKey
impl ZcashDeserialize for zebra_chain::orchard::note::ciphertexts::EncryptedNote
impl ZcashDeserialize for zebra_chain::orchard::note::ciphertexts::WrappedNoteKey
impl ZcashDeserialize for Flags
impl ZcashDeserialize for zebra_chain::orchard::tree::Root
impl ZcashDeserialize for Bctv14Proof
impl ZcashDeserialize for Groth16Proof
impl ZcashDeserialize for Halo2Proof
impl ZcashDeserialize for NotSmallOrderValueCommitment
impl ZcashDeserialize for zebra_chain::sapling::keys::EphemeralPublicKey
impl ZcashDeserialize for zebra_chain::sapling::note::ciphertexts::EncryptedNote
impl ZcashDeserialize for zebra_chain::sapling::note::ciphertexts::WrappedNoteKey
impl ZcashDeserialize for OutputInTransactionV4
impl ZcashDeserialize for OutputPrefixInTransactionV5
impl ZcashDeserialize for Spend<PerSpendAnchor>
impl ZcashDeserialize for SpendPrefixInTransactionV5
impl ZcashDeserialize for zebra_chain::sapling::tree::Root
impl ZcashDeserialize for zebra_chain::sprout::note::ciphertexts::EncryptedNote
impl ZcashDeserialize for Mac
impl ZcashDeserialize for AuthDigest
impl ZcashDeserialize for zebra_chain::transaction::hash::Hash
impl ZcashDeserialize for WtxId
impl ZcashDeserialize for Script
impl ZcashDeserialize for OutPoint
impl ZcashDeserialize for Output
impl ZcashDeserialize for CompactSize64
impl ZcashDeserialize for CompactSizeMessage
impl ZcashDeserialize for DateTime32
impl<P: ZkSnarkProof> ZcashDeserialize for JoinSplit<P>
impl<T: ZcashDeserialize + TrustedPreallocate> ZcashDeserialize for AtLeastOne<T>
Deserialize an AtLeastOne
vector, where the number of items is set by a
CompactSize prefix in the data. This is the most common format in Zcash.