Trait zcash_history::Version
source · [−]pub trait Version {
type NodeData: Debug;
fn consensus_branch_id(data: &Self::NodeData) -> u32;
fn start_height(data: &Self::NodeData) -> u64;
fn end_height(data: &Self::NodeData) -> u64;
fn combine_inner(
subtree_commitment: [u8; 32],
left: &Self::NodeData,
right: &Self::NodeData
) -> Self::NodeData;
fn read<R: Read>(
consensus_branch_id: u32,
r: &mut R
) -> Result<Self::NodeData>;
fn write<W: Write>(data: &Self::NodeData, w: &mut W) -> Result<()>;
fn combine(left: &Self::NodeData, right: &Self::NodeData) -> Self::NodeData { ... }
fn to_bytes(data: &Self::NodeData) -> Vec<u8> { ... }
fn from_bytes<T: AsRef<[u8]>>(
consensus_branch_id: u32,
buf: T
) -> Result<Self::NodeData> { ... }
fn hash(data: &Self::NodeData) -> [u8; 32] { ... }
}
Expand description
A version of the chain history tree.
Required Associated Types
Required Methods
fn consensus_branch_id(data: &Self::NodeData) -> u32
fn consensus_branch_id(data: &Self::NodeData) -> u32
Returns the consensus branch ID for the given node data.
fn start_height(data: &Self::NodeData) -> u64
fn start_height(data: &Self::NodeData) -> u64
Returns the start height for the given node data.
fn end_height(data: &Self::NodeData) -> u64
fn end_height(data: &Self::NodeData) -> u64
Returns the end height for the given node data.
Combines two nodes metadata.
For internal use.
Parses node data from the given reader.
Provided Methods
Combines two nodes’ metadata.
Convert from byte representation.