Struct common_types::views::BlockView
source · [−]pub struct BlockView<'a> { /* private fields */ }
Expand description
View onto block rlp.
Implementations
sourceimpl<'a> BlockView<'a>
impl<'a> BlockView<'a>
sourcepub fn new(rlp: ViewRlp<'a>) -> BlockView<'a>
pub fn new(rlp: ViewRlp<'a>) -> BlockView<'a>
Creates new view onto block from rlp.
Use the view!
macro to create this view in order to capture debugging info.
Example
#[macro_use]
extern crate common_types as types;
use types::views::{BlockView};
fn main() {
let bytes : &[u8] = &[];
let block_view = view!(BlockView, bytes);
}
sourcepub fn header(&self, eip1559_transition: BlockNumber) -> Header
pub fn header(&self, eip1559_transition: BlockNumber) -> Header
Create new Header object from header rlp.
sourcepub fn header_rlp(&self) -> ViewRlp<'a>
pub fn header_rlp(&self) -> ViewRlp<'a>
Return header rlp.
sourcepub fn header_view(&self) -> HeaderView<'a>
pub fn header_view(&self) -> HeaderView<'a>
Create new header view obto block head rlp.
sourcepub fn transactions(&self) -> Vec<UnverifiedTransaction>
pub fn transactions(&self) -> Vec<UnverifiedTransaction>
Return List of transactions in given block.
sourcepub fn localized_transactions(&self) -> Vec<LocalizedTransaction>
pub fn localized_transactions(&self) -> Vec<LocalizedTransaction>
Return List of transactions with additional localization info.
sourcepub fn transactions_rlp(&self) -> ViewRlp<'a>
pub fn transactions_rlp(&self) -> ViewRlp<'a>
Return the raw rlp for the transactions in the given block.
sourcepub fn transactions_count(&self) -> usize
pub fn transactions_count(&self) -> usize
Return number of transactions in given block, without deserializing them.
sourcepub fn transaction_views(&self) -> Vec<TypedTransactionView<'a>>
pub fn transaction_views(&self) -> Vec<TypedTransactionView<'a>>
Return List of transactions in given block.
sourcepub fn transaction_hashes(&self) -> Vec<H256>
pub fn transaction_hashes(&self) -> Vec<H256>
Return transaction hashes.
sourcepub fn transaction_at(&self, index: usize) -> Option<UnverifiedTransaction>
pub fn transaction_at(&self, index: usize) -> Option<UnverifiedTransaction>
Returns transaction at given index without deserializing unnecessary data.
sourcepub fn localized_transaction_at(
&self,
index: usize
) -> Option<LocalizedTransaction>
pub fn localized_transaction_at(
&self,
index: usize
) -> Option<LocalizedTransaction>
Returns localized transaction at given index.
sourcepub fn uncles_rlp(&self) -> ViewRlp<'a>
pub fn uncles_rlp(&self) -> ViewRlp<'a>
Returns raw rlp for the uncles in the given block
sourcepub fn uncles(&self, eip1559_transition: BlockNumber) -> Vec<Header>
pub fn uncles(&self, eip1559_transition: BlockNumber) -> Vec<Header>
Return list of uncles of given block.
sourcepub fn uncles_count(&self) -> usize
pub fn uncles_count(&self) -> usize
Return number of uncles in given block, without deserializing them.
sourcepub fn uncle_views(&self) -> Vec<HeaderView<'a>>
pub fn uncle_views(&self) -> Vec<HeaderView<'a>>
Return List of transactions in given block.
sourcepub fn uncle_hashes(&self) -> Vec<H256>
pub fn uncle_hashes(&self) -> Vec<H256>
Return list of uncle hashes of given block.
sourcepub fn uncle_at(
&self,
index: usize,
eip1559_transition: BlockNumber
) -> Option<Header>
pub fn uncle_at(
&self,
index: usize,
eip1559_transition: BlockNumber
) -> Option<Header>
Return nth uncle.
sourcepub fn uncle_rlp_at(&self, index: usize) -> Option<Bytes>
pub fn uncle_rlp_at(&self, index: usize) -> Option<Bytes>
Return nth uncle rlp.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for BlockView<'a>
impl<'a> Send for BlockView<'a>
impl<'a> !Sync for BlockView<'a>
impl<'a> Unpin for BlockView<'a>
impl<'a> UnwindSafe for BlockView<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more