Skip to main content

ZcashDeserializeWithContext

Trait ZcashDeserializeWithContext 

Source
pub trait ZcashDeserializeWithContext<C>: Sized {
    // Required method
    fn zcash_deserialize_with_context<R: Read>(
        reader: R,
        context: &C,
    ) -> Result<Self, SerializationError>;
}
Expand description

Consensus-critical deserialization with additional context.

Some types (e.g., Transaction, Block) require external context for deserialization that is not present in the byte stream itself. For example, zcash_primitives::transaction::Transaction::read() requires a BranchId which, for pre-V5 transactions, must be derived from the block height and network.

This trait extends ZcashDeserialize for types that need context without changing the signature of the context-free trait.

Required Methods§

Source

fn zcash_deserialize_with_context<R: Read>( reader: R, context: &C, ) -> Result<Self, SerializationError>

Try to read self from the given reader, using the provided context.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§