Struct ckb_types::core::HeaderView
source · pub struct HeaderView { /* private fields */ }
Expand description
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§
source§impl HeaderView
impl HeaderView
sourcepub fn new_advanced_builder() -> HeaderBuilder
pub fn new_advanced_builder() -> HeaderBuilder
Creates an empty advanced builder.
sourcepub fn as_advanced_builder(&self) -> HeaderBuilder
pub fn as_advanced_builder(&self) -> HeaderBuilder
Creates an advanced builder base on current data.
source§impl HeaderView
impl HeaderView
sourcepub fn data(&self) -> Header
pub fn data(&self) -> Header
Gets a clone of packed::Header
.
sourcepub fn number(&self) -> BlockNumber
pub fn number(&self) -> BlockNumber
Gets raw.number
.
sourcepub fn compact_target(&self) -> u32
pub fn compact_target(&self) -> u32
Gets raw.compact_target
.
sourcepub fn epoch(&self) -> EpochNumberWithFraction
pub fn epoch(&self) -> EpochNumberWithFraction
Gets raw.epoch
.
sourcepub fn parent_hash(&self) -> Byte32
pub fn parent_hash(&self) -> Byte32
Gets raw.parent_hash
.
sourcepub fn transactions_root(&self) -> Byte32
pub fn transactions_root(&self) -> Byte32
Gets raw.transactions_root
.
sourcepub fn proposals_hash(&self) -> Byte32
pub fn proposals_hash(&self) -> Byte32
Gets raw.proposals_hash
.
sourcepub fn extra_hash(&self) -> Byte32
pub fn extra_hash(&self) -> Byte32
Gets raw.extra_hash
.
sourcepub fn difficulty(&self) -> U256
pub fn difficulty(&self) -> U256
Gets raw.difficulty
.
sourcepub fn is_genesis(&self) -> bool
pub fn is_genesis(&self) -> bool
Checks whether the header is the header block.
source§impl HeaderView
impl HeaderView
sourcepub fn digest(&self) -> HeaderDigest
pub fn digest(&self) -> HeaderDigest
Get the MMR header digest of the header
Trait Implementations§
source§impl Clone for HeaderView
impl Clone for HeaderView
source§fn clone(&self) -> HeaderView
fn clone(&self) -> HeaderView
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for HeaderView
impl Debug for HeaderView
source§impl Display for HeaderView
impl Display for HeaderView
source§impl Hash for HeaderView
impl Hash for HeaderView
source§impl Pack<HeaderView> for HeaderView
impl Pack<HeaderView> for HeaderView
source§fn pack(&self) -> HeaderView
fn pack(&self) -> HeaderView
Packs a rust type into binary data.
source§impl PartialEq for HeaderView
impl PartialEq for HeaderView
source§impl Unpack<HeaderView> for HeaderView
impl Unpack<HeaderView> for HeaderView
source§fn unpack(&self) -> HeaderView
fn unpack(&self) -> HeaderView
Unpack binary data into rust types.
source§impl<'r> Unpack<HeaderView> for HeaderViewReader<'r>
impl<'r> Unpack<HeaderView> for HeaderViewReader<'r>
source§fn unpack(&self) -> HeaderView
fn unpack(&self) -> HeaderView
Unpack binary data into rust types.
impl Eq for HeaderView
Auto Trait Implementations§
impl !Freeze for HeaderView
impl RefUnwindSafe for HeaderView
impl Send for HeaderView
impl Sync for HeaderView
impl Unpin for HeaderView
impl UnwindSafe for HeaderView
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
Mutably borrows from an owned value. Read more