pub struct DifficultyAdjustment {
pub difficulty_change: f64,
pub estimated_retarget_date: u64,
pub remaining_blocks: u64,
pub remaining_time: u64,
pub previous_retarget: f64,
pub previous_time: u64,
pub next_retarget_height: u64,
pub time_avg: u64,
pub time_offset: i64,
}Expand description
Difficulty adjustment information.
Fields§
§difficulty_change: f64Current difficulty
estimated_retarget_date: u64Estimated seconds until next adjustment
remaining_blocks: u64Remaining blocks until adjustment
remaining_time: u64Remaining time in seconds
previous_retarget: f64Previous difficulty
previous_time: u64Previous time
next_retarget_height: u64Next retarget height
time_avg: u64Time average in seconds
time_offset: i64Time offset
Implementations§
Source§impl DifficultyAdjustment
impl DifficultyAdjustment
Sourcepub fn difficulty_change_percent(&self) -> f64
pub fn difficulty_change_percent(&self) -> f64
Get difficulty change as percentage.
Sourcepub fn remaining_hours(&self) -> f64
pub fn remaining_hours(&self) -> f64
Get remaining time in hours.
Sourcepub fn remaining_days(&self) -> f64
pub fn remaining_days(&self) -> f64
Get remaining time in days.
Sourcepub fn will_increase(&self) -> bool
pub fn will_increase(&self) -> bool
Check if difficulty will increase.
Trait Implementations§
Source§impl Clone for DifficultyAdjustment
impl Clone for DifficultyAdjustment
Source§fn clone(&self) -> DifficultyAdjustment
fn clone(&self) -> DifficultyAdjustment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DifficultyAdjustment
impl Debug for DifficultyAdjustment
Source§impl<'de> Deserialize<'de> for DifficultyAdjustment
impl<'de> Deserialize<'de> for DifficultyAdjustment
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
Source§impl PartialEq for DifficultyAdjustment
impl PartialEq for DifficultyAdjustment
Source§impl Serialize for DifficultyAdjustment
impl Serialize for DifficultyAdjustment
impl StructuralPartialEq for DifficultyAdjustment
Auto Trait Implementations§
impl Freeze for DifficultyAdjustment
impl RefUnwindSafe for DifficultyAdjustment
impl Send for DifficultyAdjustment
impl Sync for DifficultyAdjustment
impl Unpin for DifficultyAdjustment
impl UnwindSafe for DifficultyAdjustment
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