Trait storage_proofs_core::drgraph::Graph
source · pub trait Graph<H: Hasher>: Debug + Clone + PartialEq + Eq {
type Key: Debug;
// Required methods
fn parents(&self, node: usize, parents: &mut [u32]) -> Result<()>;
fn size(&self) -> usize;
fn degree(&self) -> usize;
fn new(
nodes: usize,
base_degree: usize,
expansion_degree: usize,
porep_id: PoRepID,
api_version: ApiVersion,
) -> Result<Self>;
fn seed(&self) -> [u8; 28];
fn create_key(
&self,
id: &H::Domain,
node: usize,
parents: &[u32],
parents_data: &[u8],
exp_parents_data: Option<&[u8]>,
) -> Result<Self::Key>;
// Provided methods
fn expected_size(&self) -> usize { ... }
fn merkle_tree_depth<U: 'static + PoseidonArity>(&self) -> u64 { ... }
}
Expand description
A depth robust graph.
Required Associated Types§
Required Methods§
sourcefn parents(&self, node: usize, parents: &mut [u32]) -> Result<()>
fn parents(&self, node: usize, parents: &mut [u32]) -> Result<()>
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 new( nodes: usize, base_degree: usize, expansion_degree: usize, porep_id: PoRepID, api_version: ApiVersion, ) -> Result<Self>
fn seed(&self) -> [u8; 28]
Provided Methods§
sourcefn expected_size(&self) -> usize
fn expected_size(&self) -> usize
Returns the expected size of all nodes in the graph.
sourcefn merkle_tree_depth<U: 'static + PoseidonArity>(&self) -> u64
fn merkle_tree_depth<U: 'static + PoseidonArity>(&self) -> u64
Returns the merkle tree depth.
Object Safety§
This trait is not object safe.