Struct ckb_types::core::BlockView [−][src]
pub struct BlockView { /* fields omitted */ }
Expand description
A readonly and immutable struct which includes Block
and its associated hashes.
Notice
This struct is not implement the trait Default
, use BlockBuilder
to construct it.
Implementations
Creates an advanced builder base on current data.
Gets a clone of packed::Block
.
Gets a clone of uncle_hashes
.
Extracts a slice of tx_witness_hashes
.
Gets header.raw.number
.
Gets header.raw.compact_target
.
Gets header.raw.epoch
.
Gets header.raw.parent_hash
.
Gets header.raw.transactions_root
.
Gets header.raw.proposals_hash
.
Gets header.raw.extra_hash
.
Gets header.difficulty
.
Gets header
.
Gets uncles
.
Converts into an uncle block.
Gets transactions
.
Creates an iterator from proposals
of the block and proposals
of uncles
.
Creates a hashset from proposals
of the block and proposals
of uncles
.
Gets a transaction through its index.
Gets an output through its transaction index and its own index.
Checks whether the block is the genesis block.
Calculates the hash for uncle blocks.
Calculates the hash for extension.
Calculates the extra hash.
Calculates the hash for proposals.
Calculates the merkel root for transactions with witnesses.
Calculates the merkel root for transactions without witnesses.
Calculates the merkel root for transaction witnesses.
pub fn new_unchecked(
header: HeaderView,
uncles: UncleBlockVecView,
body: Vec<TransactionView>,
proposals: ProposalShortIdVec
) -> Self
pub fn new_unchecked(
header: HeaderView,
uncles: UncleBlockVecView,
body: Vec<TransactionView>,
proposals: ProposalShortIdVec
) -> Self
pub fn new_unchecked_with_extension(
header: HeaderView,
uncles: UncleBlockVecView,
body: Vec<TransactionView>,
proposals: ProposalShortIdVec,
extension: Bytes
) -> Self
pub fn new_unchecked_with_extension(
header: HeaderView,
uncles: UncleBlockVecView,
body: Vec<TransactionView>,
proposals: ProposalShortIdVec,
extension: Bytes
) -> Self
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for BlockView
impl UnwindSafe for BlockView
Blanket Implementations
Mutably borrows from an owned value. Read more