Consensus-critical serialization for Zcash.
This trait provides a generic serialization for consensus-critical formats, such as network messages, transactions, blocks, etc. It is intended for use only in consensus-critical contexts; in other contexts, such as internal storage, it would be preferable to use Serde.
fn zcash_serialize<W: Write>(&self, writer: W) -> Result<(), Error>
self to the given
writer using the canonical format.
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.
Notice that the error type is
std::io::Error; this indicates that
serialization MUST be infallible up to errors in the underlying writer.
In other words, any type implementing
ZcashSerialize must make illegal
fn zcash_serialize_to_vec(&self) -> Result<Vec<u8>, Error>
Helper function to construct a vec to serialize the current struct into
Implementations on Foreign Types
impl ZcashSerialize for PublicKey[src]
impl<T: ZcashSerialize> ZcashSerialize for Vec<T>[src]
impl<T> ZcashSerialize for Arc<T> where[src]