[][src]Struct sv::messages::BlockHeader

pub struct BlockHeader {
    pub version: u32,
    pub prev_hash: Hash256,
    pub merkle_root: Hash256,
    pub timestamp: u32,
    pub bits: u32,
    pub nonce: u32,
}

Block header

Fields

version: u32

Block version specifying which validation rules to use

prev_hash: Hash256

Hash of the previous block

merkle_root: Hash256

Root of the merkle tree of this block's transaction hashes

timestamp: u32

Timestamp when this block was created as recorded by the miner

bits: u32

Target difficulty bits

nonce: u32

Nonce used to mine the block

Implementations

impl BlockHeader[src]

pub const SIZE: usize[src]

Size of the BlockHeader in bytes

pub fn size(&self) -> usize[src]

Returns the size of the block header in bytes

pub fn hash(&self) -> Hash256[src]

Calculates the hash for this block header

pub fn validate(
    &self,
    hash: &Hash256,
    prev_headers: &[BlockHeader]
) -> Result<()>
[src]

Checks that the block header is valid

Trait Implementations

impl Clone for BlockHeader[src]

impl Debug for BlockHeader[src]

impl Default for BlockHeader[src]

impl Eq for BlockHeader[src]

impl Hash for BlockHeader[src]

impl PartialEq<BlockHeader> for BlockHeader[src]

impl Serializable<BlockHeader> for BlockHeader[src]

impl StructuralEq for BlockHeader[src]

impl StructuralPartialEq for BlockHeader[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

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.