pub struct BlockHeader {
pub major_version: VarInt,
pub minor_version: VarInt,
pub timestamp: VarInt,
pub prev_id: Hash,
pub nonce: u32,
pub signature: MinerSig,
pub vote: Vote,
}
Expand description
A block header containing the version, the mining timestamp, the previous block hash and the nonce.
Fields
major_version: VarInt
Major version, defines the consensus rules.
minor_version: VarInt
Minor version, also used to vote.
timestamp: VarInt
Block mining timestamp.
prev_id: Hash
Previous block hash.
nonce: u32
The nonce used for the proof of work.
signature: MinerSig
Miners signature to prevent pool mining
vote: Vote
Vote
Trait Implementations
sourceimpl Clone for BlockHeader
impl Clone for BlockHeader
sourcefn clone(&self) -> BlockHeader
fn clone(&self) -> BlockHeader
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for BlockHeader
impl Debug for BlockHeader
sourceimpl Decodable for BlockHeader
impl Decodable for BlockHeader
sourcefn consensus_decode<D: Read>(d: &mut D) -> Result<BlockHeader, Error>
fn consensus_decode<D: Read>(d: &mut D) -> Result<BlockHeader, Error>
Decode an object with a well-defined format.
sourceimpl Default for BlockHeader
impl Default for BlockHeader
sourcefn default() -> BlockHeader
fn default() -> BlockHeader
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for BlockHeader
impl<'de> Deserialize<'de> for BlockHeader
sourcefn 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
sourceimpl Display for BlockHeader
impl Display for BlockHeader
sourceimpl Encodable for BlockHeader
impl Encodable for BlockHeader
sourceimpl Serialize for BlockHeader
impl Serialize for BlockHeader
Auto Trait Implementations
impl RefUnwindSafe for BlockHeader
impl Send for BlockHeader
impl Sync for BlockHeader
impl Unpin for BlockHeader
impl UnwindSafe for BlockHeader
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more