Struct resource_proof::ResourceProver
[−]
[src]
pub struct ResourceProver { /* fields omitted */ }
Object used to compute a result
Methods
impl ResourceProver
[src]
fn expected_steps(&self) -> u64
The expected number of steps is pow(2, difficulty)
.
The process is probabilistic, so the actual number of steps required may be more or less.
The length of each step depends on data size. Total expected time is proportional to
length * pow(2, difficulty)
.
fn try_step(&mut self) -> Option<u64>
Try one step; if successful return the proof result.
(This does not invalidate the prover. Continuing might find another valid solution.)
fn solve(&mut self) -> u64
Keep stepping until a solution is found. Expected time can be calculated roughly (see
expected_steps
) but there is no upper bound (besides u64::MAX
).