Struct common_types::encoded::Body
source · [−]pub struct Body(_);
Expand description
Owning block body view.
Implementations
sourceimpl Body
impl Body
sourcepub fn new(raw: Vec<u8>) -> Self
pub fn new(raw: Vec<u8>) -> Self
Create a new owning block body view. The raw bytes passed in must be an rlp-encoded block body.
sourcepub fn decode(
&self,
eip1559_transition: BlockNumber
) -> (Vec<UnverifiedTransaction>, Vec<FullHeader>)
pub fn decode(
&self,
eip1559_transition: BlockNumber
) -> (Vec<UnverifiedTransaction>, Vec<FullHeader>)
Fully decode this block body.
sourcepub fn into_inner(self) -> Vec<u8>
pub fn into_inner(self) -> Vec<u8>
Consume the view and return the raw bytes.
sourceimpl Body
impl Body
sourcepub fn transactions_rlp(&self) -> Rlp<'_>
pub fn transactions_rlp(&self) -> Rlp<'_>
Get raw rlp of transactions
sourcepub fn transactions(&self) -> Vec<UnverifiedTransaction>
pub fn transactions(&self) -> Vec<UnverifiedTransaction>
Get a vector of all transactions.
sourcepub fn transactions_count(&self) -> usize
pub fn transactions_count(&self) -> usize
Number of transactions in the block.
sourcepub fn transaction_views(&self) -> Vec<TypedTransactionView<'_>>
pub fn transaction_views(&self) -> Vec<TypedTransactionView<'_>>
A view over each transaction in the block.
sourcepub fn transaction_hashes(&self) -> Vec<H256>
pub fn transaction_hashes(&self) -> Vec<H256>
The hash of each transaction in the block.
sourcepub fn uncles_rlp(&self) -> Rlp<'_>
pub fn uncles_rlp(&self) -> Rlp<'_>
Get raw rlp of uncle headers
sourcepub fn uncles(&self, eip1559_transition: BlockNumber) -> Vec<FullHeader>
pub fn uncles(&self, eip1559_transition: BlockNumber) -> Vec<FullHeader>
Decode uncle headers.
sourcepub fn uncles_count(&self) -> usize
pub fn uncles_count(&self) -> usize
Number of uncles.
sourcepub fn uncle_views(&self) -> Vec<HeaderView<'_>>
pub fn uncle_views(&self) -> Vec<HeaderView<'_>>
Borrowed view over each uncle.
sourcepub fn uncle_hashes(&self) -> Vec<H256>
pub fn uncle_hashes(&self) -> Vec<H256>
Hash of each uncle.
Trait Implementations
sourceimpl MallocSizeOf for Body
impl MallocSizeOf for Body
sourcefn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
If T::size_of
is a constant, consider implementing constant_size
as well. Read more
sourcefn constant_size() -> Option<usize>
fn constant_size() -> Option<usize>
Used to optimize MallocSizeOf
implementation for collections
like Vec
and HashMap
to avoid iterating over them unnecessarily.
The Self: Sized
bound is for object safety. Read more
impl Eq for Body
impl StructuralEq for Body
impl StructuralPartialEq for Body
Auto Trait Implementations
impl RefUnwindSafe for Body
impl Send for Body
impl Sync for Body
impl Unpin for Body
impl UnwindSafe for Body
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
sourceimpl<T> MallocSizeOfExt for T where
T: MallocSizeOf,
impl<T> MallocSizeOfExt for T where
T: MallocSizeOf,
sourcefn malloc_size_of(&self) -> usize
fn malloc_size_of(&self) -> usize
Method to launch a heapsize measurement with a fresh state. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more