Struct monero::blockdata::block::BlockHeader[][src]

pub struct BlockHeader {
    pub major_version: VarInt,
    pub minor_version: VarInt,
    pub timestamp: VarInt,
    pub prev_id: Hash,
    pub nonce: u32,
}
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.

Trait Implementations

impl Clone for BlockHeader[src]

fn clone(&self) -> BlockHeader[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for BlockHeader[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Decodable for BlockHeader[src]

fn consensus_decode<D: Read>(d: &mut D) -> Result<BlockHeader, Error>[src]

Decode an object with a well-defined format.

impl Default for BlockHeader[src]

fn default() -> BlockHeader[src]

Returns the “default value” for a type. Read more

impl<'de> Deserialize<'de> for BlockHeader[src]

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl Display for BlockHeader[src]

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>[src]

Formats the value using the given formatter. Read more

impl Encodable for BlockHeader[src]

fn consensus_encode<S: Write>(&self, s: &mut S) -> Result<usize, Error>[src]

Encode an object with a well-defined format, should only ever error if the underlying Encoder errors. Read more

impl Serialize for BlockHeader[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl StrictDecode for BlockHeader[src]

This is supported on crate feature strict_encoding_support only.

fn strict_decode<D: Read>(d: D) -> Result<Self, Error>[src]

Decode with the given [std::io::Reader] instance; must either construct an instance or return implementation-specific error type. Read more

fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>[src]

Tries to deserialize byte array into the current type using [strict_decode()] Read more

impl StrictEncode for BlockHeader[src]

This is supported on crate feature strict_encoding_support only.

fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>[src]

Encode with the given [std::io::Writer] instance; must return result with either amount of bytes encoded – or implementation-specific error type. Read more

fn strict_serialize(&self) -> Result<Vec<u8, Global>, Error>[src]

Serializes data as a byte array using [strict_encode()] function

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]