Struct lucky_commit_lib::HashSearchWorker[][src]

pub struct HashSearchWorker { /* fields omitted */ }

A worker that, when invoked, will look in a predetermined search space to find a modification to a specific commit that matches a specific hash prefix.

Implementations

impl HashSearchWorker[src]

pub fn new(current_commit: &[u8], desired_prefix: HashPrefix) -> Self[src]

Creates a worker for a specific commit and prefix, with an initial workload of 1 ** 48 units. As a rough approximation depending on hardware, each worker can perform about 7 million units of work per second.

pub fn with_capped_search_space(self, workload: u64) -> Self[src]

Caps a worker's search space to approximately the given size.

pub fn search(self) -> Option<HashMatch>[src]

Invokes the worker. The worker will return early with a hash match if it finds one, otherwise it will search its entire search space and return None.

Trait Implementations

impl Debug for HashSearchWorker[src]

impl PartialEq<HashSearchWorker> for HashSearchWorker[src]

impl StructuralPartialEq for HashSearchWorker[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.