[][src]Struct grin_core::consensus::HeaderInfo

pub struct HeaderInfo {
    pub timestamp: u64,
    pub difficulty: Difficulty,
    pub secondary_scaling: u32,
    pub is_secondary: bool,
}

Minimal header information required for the Difficulty calculation to take place

Fields

timestamp: u64

Timestamp of the header, 1 when not used (returned info)

difficulty: Difficulty

Network difficulty or next difficulty to use

secondary_scaling: u32

Network secondary PoW factor or factor to use

is_secondary: bool

Whether the header is a secondary proof of work

Methods

impl HeaderInfo[src]

pub fn new(
    timestamp: u64,
    difficulty: Difficulty,
    secondary_scaling: u32,
    is_secondary: bool
) -> HeaderInfo
[src]

Default constructor

pub fn from_ts_diff(timestamp: u64, difficulty: Difficulty) -> HeaderInfo[src]

Constructor from a timestamp and difficulty, setting a default secondary PoW factor

pub fn from_diff_scaling(
    difficulty: Difficulty,
    secondary_scaling: u32
) -> HeaderInfo
[src]

Constructor from a difficulty and secondary factor, setting a default timestamp

Trait Implementations

impl PartialEq<HeaderInfo> for HeaderInfo[src]

impl Eq for HeaderInfo[src]

impl Clone for HeaderInfo[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for HeaderInfo[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

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

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.

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

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

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

impl<T> DebugAny for T where
    T: Any + Debug

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> UnsafeAny for T where
    T: Any

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Erased for T