Struct resource_proof::ResourceProver [−][src]
Object used to compute a result
Implementations
impl ResourceProver
[src]
pub fn expected_steps(&self) -> u64
[src]
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)
.
pub fn try_step(&mut self) -> Option<u64>
[src]
Try one step; if successful return the proof result.
(This does not invalidate the prover. Continuing might find another valid solution.)
pub fn solve(&mut self) -> u64
[src]
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
).
Auto Trait Implementations
impl RefUnwindSafe for ResourceProver
impl Send for ResourceProver
impl Sync for ResourceProver
impl Unpin for ResourceProver
impl UnwindSafe for ResourceProver
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,