[][src]Trait storage_proofs::drgraph::Graph

pub trait Graph<H: Hasher>: Debug + Clone + PartialEq + Eq {
    fn parents(&self, node: usize, parents: &mut [usize]);
fn size(&self) -> usize;
fn degree(&self) -> usize;
fn new(
        nodes: usize,
        base_degree: usize,
        expansion_degree: usize,
        seed: [u32; 7]
    ) -> Self;
fn seed(&self) -> [u32; 7]; fn expected_size(&self) -> usize { ... }
fn merkle_tree<'a>(
        &self,
        data: &'a [u8]
    ) -> Result<MerkleTree<H::Domain, H::Function>> { ... }
fn merkle_tree_aux<'a>(
        &self,
        data: &'a [u8],
        parallel: bool
    ) -> Result<MerkleTree<H::Domain, H::Function>> { ... }
fn merkle_tree_depth(&self) -> u64 { ... }
fn forward(&self) -> bool { ... } }

A depth robust graph.

Required methods

fn parents(&self, node: usize, parents: &mut [usize])

Returns a sorted list of all parents of this node. The parents may be repeated.

If a node doesn't have any parents, then this vector needs to return a vector where the first element is the requested node. This will be used as indicator for nodes without parents.

The parents parameter is used to store the result. This is done fore performance reasons, so that the vector can be allocated outside this call.

fn size(&self) -> usize

Returns the size of the graph (number of nodes).

fn degree(&self) -> usize

Returns the number of parents of each node in the graph.

fn new(
    nodes: usize,
    base_degree: usize,
    expansion_degree: usize,
    seed: [u32; 7]
) -> Self

fn seed(&self) -> [u32; 7]

Loading content...

Provided methods

fn expected_size(&self) -> usize

Returns the expected size of all nodes in the graph.

fn merkle_tree<'a>(
    &self,
    data: &'a [u8]
) -> Result<MerkleTree<H::Domain, H::Function>>

Builds a merkle tree based on the given data.

fn merkle_tree_aux<'a>(
    &self,
    data: &'a [u8],
    parallel: bool
) -> Result<MerkleTree<H::Domain, H::Function>>

Builds a merkle tree based on the given data.

fn merkle_tree_depth(&self) -> u64

Returns the merkle tree depth.

fn forward(&self) -> bool

Loading content...

Implementors

impl<H: Hasher> Graph<H> for BucketGraph<H>[src]

impl<Z: ZigZag> Graph<<Z as ZigZag>::BaseHasher> for Z[src]

Loading content...