pub struct BlockHeader {
pub version: u32,
pub previous_hash: String,
pub merkle_root: String,
pub time: u32,
pub bits: u32,
pub nonce: u32,
pub height: u32,
pub hash: String,
}Expand description
Fields of an 80-byte serialized block header whose double SHA-256 hash produces the block hash.
All hash values are 32-byte hex strings with byte order reversed from the serialized byte order.
Fields§
§version: u32Block header version value (4 bytes serialized).
previous_hash: StringHash of the previous block header (32 bytes serialized).
merkle_root: StringRoot hash of the merkle tree of all transactions (32 bytes serialized).
time: u32Block header time value (4 bytes serialized).
bits: u32Block header bits (difficulty target) value (4 bytes serialized).
nonce: u32Block header nonce value (4 bytes serialized).
height: u32Height of the header, starting from zero.
hash: StringThe double SHA-256 hash of the serialized base header fields.
Trait Implementations§
Source§impl Clone for BlockHeader
impl Clone for BlockHeader
Source§fn clone(&self) -> BlockHeader
fn clone(&self) -> BlockHeader
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
Source§impl From<BlockHeader> for BlockHeader
Convert the chaintracks-layer BlockHeader into the services-layer BlockHeader.
impl From<BlockHeader> for BlockHeader
Convert the chaintracks-layer BlockHeader into the services-layer BlockHeader.
Both structs have identical fields; this is a field-by-field copy.
Source§fn from(h: BlockHeader) -> Self
fn from(h: BlockHeader) -> Self
Auto Trait Implementations§
impl Freeze for BlockHeader
impl RefUnwindSafe for BlockHeader
impl Send for BlockHeader
impl Sync for BlockHeader
impl Unpin for BlockHeader
impl UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more