pub struct StubParallelPowGenerator { /* private fields */ }Implementations§
Trait Implementations§
Source§impl Default for StubParallelPowGenerator
impl Default for StubParallelPowGenerator
Source§impl ParallelPowGenerator for StubParallelPowGenerator
impl ParallelPowGenerator for StubParallelPowGenerator
Source§fn generate_best_effort<'life0, 'life1, 'async_trait>(
&'life0 self,
_label: &'life1 str,
iteration_limit: usize,
pow_min: Pow,
data_hash: Hash,
) -> Pin<Box<dyn Future<Output = Result<(Salt, Pow, Hash)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate_best_effort<'life0, 'life1, 'async_trait>(
&'life0 self,
_label: &'life1 str,
iteration_limit: usize,
pow_min: Pow,
data_hash: Hash,
) -> Pin<Box<dyn Future<Output = Result<(Salt, Pow, Hash)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Run up to
iteration_limit hash attempts and return the best (Salt, Pow, Hash) found.
Exits early if pow >= pow_min is achieved. Read moreSource§fn generate<'life0, 'life1, 'async_trait>(
&'life0 self,
label: &'life1 str,
pow_min: Pow,
data_hash: Hash,
) -> Pin<Box<dyn Future<Output = Result<(Salt, Pow, Hash)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate<'life0, 'life1, 'async_trait>(
&'life0 self,
label: &'life1 str,
pow_min: Pow,
data_hash: Hash,
) -> Pin<Box<dyn Future<Output = Result<(Salt, Pow, Hash)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Loop
generate_best_effort in batches until pow >= pow_min is achieved.Source§fn active_jobs(&self) -> Vec<PowJobStatus>
fn active_jobs(&self) -> Vec<PowJobStatus>
Snapshot of all concurrently in-flight tracked jobs.
Source§fn tracker(&self) -> &Arc<Mutex<JobTracker>>
fn tracker(&self) -> &Arc<Mutex<JobTracker>>
Accessor for the impl’s
JobTracker. Exists so the default generate_best_effort_tracked
implementation can register the job without each impl having to duplicate the wrapping.Source§fn generate_best_effort_tracked<'life0, 'life1, 'async_trait>(
&'life0 self,
label: &'life1 str,
iteration_limit: usize,
pow_min: Pow,
data_hash: Hash,
) -> Pin<Box<dyn Future<Output = Result<(Salt, Pow, Hash)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate_best_effort_tracked<'life0, 'life1, 'async_trait>(
&'life0 self,
label: &'life1 str,
iteration_limit: usize,
pow_min: Pow,
data_hash: Hash,
) -> Pin<Box<dyn Future<Output = Result<(Salt, Pow, Hash)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
generate_best_effort plus tracker registration for the duration of the call.
Use this when a single-batch PoW is run directly (i.e. not inside generate_loop),
otherwise the job is invisible to active_jobs().Auto Trait Implementations§
impl Freeze for StubParallelPowGenerator
impl RefUnwindSafe for StubParallelPowGenerator
impl Send for StubParallelPowGenerator
impl Sync for StubParallelPowGenerator
impl Unpin for StubParallelPowGenerator
impl UnsafeUnpin for StubParallelPowGenerator
impl UnwindSafe for StubParallelPowGenerator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more