[−][src]Struct ckb_types::core::BlockView
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
impl BlockView
[src]
pub fn as_advanced_builder(&self) -> BlockBuilder
[src]
Creates an advanced builder base on current data.
impl BlockView
[src]
pub fn data(&self) -> Block
[src]
Gets a clone of packed::Block
.
pub fn hash(&self) -> Byte32
[src]
Gets a clone of hash
.
pub fn uncle_hashes(&self) -> Byte32Vec
[src]
Gets a clone of uncle_hashes
.
pub fn tx_hashes(&self) -> &[Byte32]
[src]
Extracts a slice of tx_hashes
.
pub fn tx_witness_hashes(&self) -> &[Byte32]
[src]
Extracts a slice of tx_witness_hashes
.
pub fn version(&self) -> Version
[src]
Gets header.raw.version
.
pub fn number(&self) -> BlockNumber
[src]
Gets header.raw.number
.
pub fn compact_target(&self) -> u32
[src]
Gets header.raw.compact_target
.
pub fn timestamp(&self) -> u64
[src]
Gets header.raw.timestamp
.
pub fn epoch(&self) -> EpochNumberWithFraction
[src]
Gets header.raw.epoch
.
pub fn parent_hash(&self) -> Byte32
[src]
Gets header.raw.parent_hash
.
pub fn transactions_root(&self) -> Byte32
[src]
Gets header.raw.transactions_root
.
pub fn proposals_hash(&self) -> Byte32
[src]
Gets header.raw.proposals_hash
.
pub fn uncles_hash(&self) -> Byte32
[src]
Gets header.raw.uncles_hash
.
pub fn dao(&self) -> Byte32
[src]
Gets header.raw.dao
.
pub fn nonce(&self) -> u128
[src]
Gets header.nonce
.
pub fn difficulty(&self) -> U256
[src]
Gets header.difficulty
.
pub fn header(&self) -> HeaderView
[src]
Gets header
.
pub fn uncles(&self) -> UncleBlockVecView
[src]
Gets uncles
.
pub fn as_uncle(&self) -> UncleBlockView
[src]
Converts into an uncle block.
pub fn transactions(&self) -> Vec<TransactionView>
[src]
Gets transactions
.
pub fn union_proposal_ids_iter(&self) -> impl Iterator<Item = ProposalShortId>
[src]
Creates an iterator from proposals
of the block and proposals
of uncles
.
pub fn union_proposal_ids(&self) -> HashSet<ProposalShortId>
[src]
Creates a hashset from proposals
of the block and proposals
of uncles
.
pub fn transaction(&self, index: usize) -> Option<TransactionView>
[src]
Gets a transaction through its index.
pub fn output(&self, tx_index: usize, index: usize) -> Option<CellOutput>
[src]
Gets an output through its transaction index and its own index.
pub fn fake_hash(self, hash: Byte32) -> Self
[src]
Sets a fake header hash.
pub fn is_genesis(&self) -> bool
[src]
Checks whether the block is the genesis block.
pub fn calc_uncles_hash(&self) -> Byte32
[src]
Calculates the hash for uncle blocks.
pub fn calc_proposals_hash(&self) -> Byte32
[src]
Calculates the hash for proposals.
pub fn calc_transactions_root(&self) -> Byte32
[src]
Calculates the merkel root for transactions with witnesses.
pub fn calc_raw_transactions_root(&self) -> Byte32
[src]
Calculates the merkel root for transactions without witnesses.
pub fn calc_witnesses_root(&self) -> Byte32
[src]
Calculates the merkel root for transaction witnesses.
impl BlockView
[src]
pub fn new_unchecked(
header: HeaderView,
uncles: UncleBlockVecView,
body: Vec<TransactionView>,
proposals: ProposalShortIdVec
) -> Self
[src]
header: HeaderView,
uncles: UncleBlockVecView,
body: Vec<TransactionView>,
proposals: ProposalShortIdVec
) -> Self
Trait Implementations
impl Clone for BlockView
[src]
impl Debug for BlockView
[src]
impl Display for BlockView
[src]
impl Eq for BlockView
[src]
impl Hash for BlockView
[src]
pub fn hash<H: Hasher>(&self, state: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<BlockView> for BlockView
[src]
Auto Trait Implementations
impl RefUnwindSafe for BlockView
[src]
impl Send for BlockView
[src]
impl Sync for BlockView
[src]
impl Unpin for BlockView
[src]
impl UnwindSafe for BlockView
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,