Trait bee_pow::providers::NonceProvider[][src]

pub trait NonceProvider: Sized {
    type Builder: NonceProviderBuilder<Provider = Self>;
    type Error: Error;
    fn nonce(&self, bytes: &[u8], target_score: f64) -> Result<u64, Self::Error>;

    fn builder() -> Self::Builder { ... }
}

A trait describing how a nonce is provided.

Associated Types

type Builder: NonceProviderBuilder<Provider = Self>[src]

The type of the nonce provider builder.

type Error: Error[src]

Type of errors occurring when providing nonces.

Loading content...

Required methods

fn nonce(&self, bytes: &[u8], target_score: f64) -> Result<u64, Self::Error>[src]

Provides a nonce given bytes and a target score.

Loading content...

Provided methods

fn builder() -> Self::Builder[src]

Returns a builder for this nonce provider.

Loading content...

Implementations on Foreign Types

impl NonceProvider for u64[src]

A nonce provider that returns constant nonces.

type Builder = u64

type Error = Infallible

Loading content...

Implementors

impl NonceProvider for Miner[src]

type Builder = MinerBuilder

type Error = Error

Loading content...