[][src]Struct zcash_history::NodeData

#[repr(C)]
pub struct NodeData {
    pub consensus_branch_id: u32,
    pub subtree_commitment: [u8; 32],
    pub start_time: u32,
    pub end_time: u32,
    pub start_target: u32,
    pub end_target: u32,
    pub start_sapling_root: [u8; 32],
    pub end_sapling_root: [u8; 32],
    pub subtree_total_work: U256,
    pub start_height: u64,
    pub end_height: u64,
    pub sapling_tx: u64,
}

Node metadata.

Fields

consensus_branch_id: u32

Consensus branch id, should be provided by deserializing node.

subtree_commitment: [u8; 32]

Subtree commitment - either block hash for leaves or hashsum of children for nodes.

start_time: u32

Start time.

end_time: u32

End time.

start_target: u32

Start target.

end_target: u32

End target.

start_sapling_root: [u8; 32]

Start sapling tree root.

end_sapling_root: [u8; 32]

End sapling tree root.

subtree_total_work: U256

Part of tree total work.

start_height: u64

Start height.

end_height: u64

End height

sapling_tx: u64

Number of Sapling transactions.

Methods

impl NodeData[src]

pub fn combine(left: &NodeData, right: &NodeData) -> NodeData[src]

Combine two nodes metadata.

pub fn write<W: Write>(&self, w: &mut W) -> Result<()>[src]

Write to the byte representation.

pub fn read<R: Read>(consensus_branch_id: u32, r: &mut R) -> Result<Self>[src]

Read from the byte representation.

pub fn to_bytes(&self) -> Vec<u8>[src]

Convert to byte representation.

pub fn from_bytes<T: AsRef<[u8]>>(
    consensus_branch_id: u32,
    buf: T
) -> Result<Self>
[src]

Convert from byte representation.

pub fn hash(&self) -> [u8; 32][src]

Hash node metadata

Trait Implementations

impl Clone for NodeData[src]

impl Debug for NodeData[src]

impl Default for NodeData[src]

impl From<NodeData> for Entry[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.