pub struct BlockHeaderData {
    pub header: BlockHeader,
    pub height: u32,
    pub chainwork: Uint256,
}
Expand description

A block header and some associated data. This information should be available from most block sources (and, notably, is available in Bitcoin Core’s RPC and REST interfaces).

Fields§

§header: BlockHeader

The block header itself.

§height: u32

The block height where the genesis block has height 0.

§chainwork: Uint256

The total chain work in expected number of double-SHA256 hashes required to build a chain of equivalent weight.

Trait Implementations§

source§

impl Clone for BlockHeaderData

source§

fn clone(&self) -> BlockHeaderData

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BlockHeaderData

source§

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

Formats the value using the given formatter. Read more
source§

impl PartialEq<BlockHeaderData> for BlockHeaderData

source§

fn eq(&self, other: &BlockHeaderData) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<Value> for BlockHeaderData

Available on crate features rest-client or rpc-client only.
§

type Error = ()

The type returned in the event of a conversion error.
source§

fn try_from(response: Value) -> Result<Self, ()>

Performs the conversion.
source§

impl TryInto<BlockHeaderData> for JsonResponse

Available on crate features rest-client or rpc-client only.

Converts a JSON value into block header data. The JSON value may be an object representing a block header or an array of such objects. In the latter case, the first object is converted.

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<BlockHeaderData>

Performs the conversion.
source§

impl Validate for BlockHeaderData

§

type T = ValidatedBlockHeader

The validated data wrapper which can be dereferenced to obtain the validated data.
source§

fn validate(self, block_hash: BlockHash) -> BlockSourceResult<Self::T>

Validates the chain data against the given block hash and any criteria needed to ensure that it is internally consistent.
source§

impl Copy for BlockHeaderData

source§

impl Eq for BlockHeaderData

source§

impl StructuralEq for BlockHeaderData

source§

impl StructuralPartialEq for BlockHeaderData

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.