pub struct BlockHeader {
    pub version: i32,
    pub prev_block_hash: BlockHash,
    pub merkle_root: BlockMerkleRoot,
    pub time: u32,
    pub bits: u32,
    pub nonce: u32,
}Fields§
§version: i32Block version, now repurposed for soft fork signalling.
prev_block_hash: BlockHashReference to the previous block in the chain.
merkle_root: BlockMerkleRootThe root hash of the merkle tree of transactions in the block.
time: u32The timestamp of the block, as claimed by the miner.
bits: u32The target value below which the blockhash must lie.
nonce: u32The nonce, selected to obtain a low enough blockhash.
Implementations§
Source§impl BlockHeader
 
impl BlockHeader
pub fn block_hash(&self) -> BlockHash
Trait Implementations§
Source§impl Clone for BlockHeader
 
impl Clone for BlockHeader
Source§fn clone(&self) -> BlockHeader
 
fn clone(&self) -> BlockHeader
Returns a copy 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 ConsensusDecode for BlockHeader
 
impl ConsensusDecode for BlockHeader
fn consensus_decode( reader: &mut impl Read, ) -> Result<BlockHeader, ConsensusDecodeError>
fn consensus_deserialize( bytes: impl AsRef<[u8]>, ) -> Result<Self, ConsensusDecodeError>
Source§impl ConsensusEncode for BlockHeader
 
impl ConsensusEncode for BlockHeader
Source§impl Debug for BlockHeader
 
impl Debug for BlockHeader
Source§impl Display for BlockHeader
 
impl Display for BlockHeader
Source§impl FromStr for BlockHeader
 
impl FromStr for BlockHeader
Source§type Err = BlockDataParseError
 
type Err = BlockDataParseError
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<BlockHeader, <BlockHeader as FromStr>::Err>
 
fn from_str(s: &str) -> Result<BlockHeader, <BlockHeader as FromStr>::Err>
Parses a string 
s to return a value of this type. Read moreSource§impl Hash for BlockHeader
 
impl Hash for BlockHeader
Source§impl LowerHex for BlockHeader
 
impl LowerHex for BlockHeader
Source§impl Ord for BlockHeader
 
impl Ord for BlockHeader
Source§fn cmp(&self, other: &BlockHeader) -> Ordering
 
fn cmp(&self, other: &BlockHeader) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn max(self, other: Self) -> Selfwhere
    Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for BlockHeader
 
impl PartialEq for BlockHeader
Source§impl PartialOrd for BlockHeader
 
impl PartialOrd for BlockHeader
Source§impl StrictDecode for BlockHeader
 
impl StrictDecode for BlockHeader
fn strict_decode( reader: &mut impl TypedRead, ) -> Result<BlockHeader, DecodeError>
fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>
Source§impl StrictDumb for BlockHeader
 
impl StrictDumb for BlockHeader
fn strict_dumb() -> BlockHeader
Source§impl StrictEncode for BlockHeader
 
impl StrictEncode for BlockHeader
fn strict_encode<W>(&self, writer: W) -> Result<W, Error>where
    W: TypedWrite,
fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>
Source§impl StrictStruct for BlockHeader
 
impl StrictStruct for BlockHeader
const ALL_FIELDS: &'static [&'static str]
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
Source§impl StrictType for BlockHeader
 
impl StrictType for BlockHeader
const STRICT_LIB_NAME: &'static str = LIB_NAME_BITCOIN
fn strict_name() -> Option<TypeName>
impl Copy for BlockHeader
impl Eq for BlockHeader
impl StrictProduct for BlockHeader
impl StructuralPartialEq for BlockHeader
Auto Trait Implementations§
impl Freeze for BlockHeader
impl RefUnwindSafe for BlockHeader
impl Send for BlockHeader
impl Sync for BlockHeader
impl Unpin for BlockHeader
impl UnwindSafe for BlockHeader
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> Comparable<K> for Q
 
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
 
impl<Q, K> Equivalent<K> for Q
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.