pub struct HeaderInfo {
pub block_hash: Hash,
pub timestamp: u64,
pub difficulty: Difficulty,
pub secondary_scaling: u32,
pub is_secondary: bool,
pub prev_timespan: u64,
}Expand description
Minimal header information required for the Difficulty calculation to take place
Fields§
§block_hash: HashBlock hash, ZERO_HASH when this is a sythetic entry.
timestamp: u64Timestamp of the header, 1 when not used (returned info)
difficulty: DifficultyNetwork difficulty or next difficulty to use
secondary_scaling: u32Network secondary PoW factor or factor to use
is_secondary: boolWhether the header is a secondary proof of work
prev_timespan: u64timespan of the previous block of the same algorithm type
Implementations§
Source§impl HeaderInfo
impl HeaderInfo
Sourcepub fn new(
block_hash: Hash,
timestamp: u64,
difficulty: Difficulty,
secondary_scaling: u32,
is_secondary: bool,
prev_timespan: u64,
) -> HeaderInfo
pub fn new( block_hash: Hash, timestamp: u64, difficulty: Difficulty, secondary_scaling: u32, is_secondary: bool, prev_timespan: u64, ) -> HeaderInfo
Default constructor
Sourcepub fn from_ts_diff(timestamp: u64, difficulty: Difficulty) -> HeaderInfo
pub fn from_ts_diff(timestamp: u64, difficulty: Difficulty) -> HeaderInfo
Constructor from a timestamp and difficulty, setting a default secondary PoW factor
Sourcepub fn from_diff_scaling(
difficulty: Difficulty,
secondary_scaling: u32,
) -> HeaderInfo
pub fn from_diff_scaling( difficulty: Difficulty, secondary_scaling: u32, ) -> HeaderInfo
Constructor from a difficulty and secondary factor, setting a default timestamp
Trait Implementations§
Source§impl Clone for HeaderInfo
impl Clone for HeaderInfo
Source§fn clone(&self) -> HeaderInfo
fn clone(&self) -> HeaderInfo
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 HeaderInfo
impl Debug for HeaderInfo
Source§impl PartialEq for HeaderInfo
impl PartialEq for HeaderInfo
impl Eq for HeaderInfo
impl StructuralPartialEq for HeaderInfo
Auto Trait Implementations§
impl Freeze for HeaderInfo
impl RefUnwindSafe for HeaderInfo
impl Send for HeaderInfo
impl Sync for HeaderInfo
impl Unpin for HeaderInfo
impl UnwindSafe for HeaderInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.