pub struct PoWConfig {
pub max_attempts: i64,
pub progress_reporting_interval: u64,
}Expand description
Configuration parameters for proof-of-work challenges.
§Arguments
max_attempts: number of nonces to try before terminating (giving up).progress_reporting_interval: The interval for every progress report callback (in attempts).
Fields§
§max_attempts: i64§progress_reporting_interval: u64Implementations§
Source§impl PoWConfig
impl PoWConfig
pub fn single_threaded() -> Self
pub fn multi_threaded() -> Self
Sourcepub fn custom(max_attempts: i64, progress_reporting_interval: u64) -> Self
pub fn custom(max_attempts: i64, progress_reporting_interval: u64) -> Self
Create a custom configuration with specified parameters.
§Arguments
max_attempts: number of nonces to try before terminating (giving up).progress_reporting_interval: The interval for every progress report callback (in attempts).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PoWConfig
impl<'de> Deserialize<'de> for PoWConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PoWConfig
impl RefUnwindSafe for PoWConfig
impl Send for PoWConfig
impl Sync for PoWConfig
impl Unpin for PoWConfig
impl UnsafeUnpin for PoWConfig
impl UnwindSafe for PoWConfig
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