[][src]Struct ckb_types::core::HeaderView

pub struct HeaderView { /* fields omitted */ }

A readonly and immutable struct which includes Header and its hash.

Notice

This struct is not implement the trait Default, use HeaderBuilder to construct it.

Implementations

impl HeaderView[src]

pub fn as_advanced_builder(&self) -> HeaderBuilder[src]

Creates an advanced builder base on current data.

impl HeaderView[src]

pub fn data(&self) -> Header[src]

Gets a clone of packed::Header.

pub fn hash(&self) -> Byte32[src]

Gets a clone of hash.

pub fn version(&self) -> Version[src]

Gets raw.version.

pub fn number(&self) -> BlockNumber[src]

Gets raw.number.

pub fn compact_target(&self) -> u32[src]

Gets raw.compact_target.

pub fn timestamp(&self) -> u64[src]

Gets raw.timestamp.

pub fn epoch(&self) -> EpochNumberWithFraction[src]

Gets raw.epoch.

pub fn parent_hash(&self) -> Byte32[src]

Gets raw.parent_hash.

pub fn transactions_root(&self) -> Byte32[src]

Gets raw.transactions_root.

pub fn proposals_hash(&self) -> Byte32[src]

Gets raw.proposals_hash.

pub fn uncles_hash(&self) -> Byte32[src]

Gets raw.uncles_hash.

pub fn dao(&self) -> Byte32[src]

Gets raw.dao.

pub fn difficulty(&self) -> U256[src]

Gets raw.difficulty.

pub fn nonce(&self) -> u128[src]

Gets nonce.

pub fn is_genesis(&self) -> bool[src]

Checks whether the header is the header block.

pub fn fake_hash(self, hash: Byte32) -> Self[src]

Sets a fake header hash.

Trait Implementations

impl Clone for HeaderView[src]

impl Debug for HeaderView[src]

impl Display for HeaderView[src]

impl Eq for HeaderView[src]

impl Hash for HeaderView[src]

impl Pack<HeaderView> for HeaderView[src]

impl PartialEq<HeaderView> for HeaderView[src]

impl<'r> Unpack<HeaderView> for HeaderViewReader<'r>[src]

impl Unpack<HeaderView> for HeaderView[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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

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.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,