Struct ck_doge_types::block::BlockHeader
source · pub struct BlockHeader {
pub version: u32,
pub prev_blockhash: BlockHash,
pub merkle_root: TxMerkleNode,
pub time: u32,
pub bits: u32,
pub nonce: u32,
}Fields§
§version: u32Block version, now repurposed for soft fork signalling.
prev_blockhash: BlockHashReference to the previous block in the chain.
merkle_root: TxMerkleNodeThe 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 const VERSION_AUXPOW: u32 = 256u32
sourcepub const VERSION_CHAIN_START: u32 = 65_536u32
pub const VERSION_CHAIN_START: u32 = 65_536u32
Bits above are reserved for the auxpow chain ID.
pub fn is_null(&self) -> bool
pub fn is_auxpow(&self) -> bool
pub fn chain_id(&self) -> u32
pub fn is_legacy(&self) -> bool
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 Debug for BlockHeader
impl Debug for BlockHeader
source§impl Decodable for BlockHeader
impl Decodable for BlockHeader
source§impl Encodable for BlockHeader
impl Encodable for BlockHeader
source§impl From<&BlockHeader> for BlockHash
impl From<&BlockHeader> for BlockHash
source§fn from(header: &BlockHeader) -> BlockHash
fn from(header: &BlockHeader) -> BlockHash
Converts to this type from the input type.
source§impl From<BlockHeader> for BlockHash
impl From<BlockHeader> for BlockHash
source§fn from(header: BlockHeader) -> BlockHash
fn from(header: BlockHeader) -> BlockHash
Converts to this type from the input type.
source§impl Hash for BlockHeader
impl Hash 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§fn eq(&self, other: &BlockHeader) -> bool
fn eq(&self, other: &BlockHeader) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd for BlockHeader
impl PartialOrd for BlockHeader
source§fn partial_cmp(&self, other: &BlockHeader) -> Option<Ordering>
fn partial_cmp(&self, other: &BlockHeader) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq 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