Struct ex3_blockchain_public_types::BlockHeader
source · pub struct BlockHeader {
pub version: u8,
pub timestamp: TimeInNs,
pub height: SerdeBlockHeight,
pub p_id: SerdePackageId,
pub pre_block_hash: BlockHash,
pub tx_root: [u8; 32],
pub balance_changed_root: [u8; 32],
}
Expand description
Block header
Fields§
§version: u8
§timestamp: TimeInNs
§height: SerdeBlockHeight
§p_id: SerdePackageId
§pre_block_hash: BlockHash
§tx_root: [u8; 32]
§balance_changed_root: [u8; 32]
Implementations§
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<'de> Deserialize<'de> for BlockHeader
impl<'de> Deserialize<'de> for BlockHeader
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<BlockHeader> for CandidBlockHeader
impl From<BlockHeader> for CandidBlockHeader
source§fn from(block_header: BlockHeader) -> Self
fn from(block_header: BlockHeader) -> Self
Converts to this type from the input type.
source§impl From<BlockHeader> for EncodedBlockHeader
impl From<BlockHeader> for EncodedBlockHeader
source§fn from(header: BlockHeader) -> Self
fn from(header: BlockHeader) -> Self
Converts to this type from the input type.
source§impl From<CandidBlockHeader> for BlockHeader
impl From<CandidBlockHeader> for BlockHeader
source§fn from(candid_block_header: CandidBlockHeader) -> Self
fn from(candid_block_header: CandidBlockHeader) -> Self
Converts to this type from the input type.
source§impl From<EncodedBlockHeader> for BlockHeader
impl From<EncodedBlockHeader> for BlockHeader
source§fn from(encoded_header: EncodedBlockHeader) -> Self
fn from(encoded_header: EncodedBlockHeader) -> Self
Converts to this type from the input type.
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<BlockHeader> for BlockHeader
impl PartialEq<BlockHeader> 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<BlockHeader> for BlockHeader
impl PartialOrd<BlockHeader> 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 more