pub enum BlockTransactions<T> {
Full(Vec<T>),
Hashes(Vec<B256>),
Uncle,
}
Expand description
Block Transactions depending on the boolean attribute of eth_getBlockBy*
,
or if used by eth_getUncle*
Variants§
Implementations§
Source§impl<T> BlockTransactions<T>
impl<T> BlockTransactions<T>
Sourcepub const fn is_full(&self) -> bool
pub const fn is_full(&self) -> bool
Returns true if the enum variant is used for full transactions.
Sourcepub fn as_transactions(&self) -> Option<&[T]>
pub fn as_transactions(&self) -> Option<&[T]>
Fallibly cast to a slice of transactions.
Returns None
if the enum variant is not Full
.
Sourcepub const fn is_uncle(&self) -> bool
pub const fn is_uncle(&self) -> bool
Returns true if the enum variant is used for an uncle response.
Sourcepub fn txns(&self) -> impl Iterator<Item = &T>
pub fn txns(&self) -> impl Iterator<Item = &T>
Returns an iterator over the transactions (if any). This will be empty if the block is an uncle or if the transaction list contains only hashes.
Sourcepub fn into_transactions(self) -> IntoIter<T>
pub fn into_transactions(self) -> IntoIter<T>
Returns an iterator over the transactions (if any). This will be empty if the block is not full.
Source§impl<T: TransactionResponse> BlockTransactions<T>
impl<T: TransactionResponse> BlockTransactions<T>
Sourcepub fn convert_to_hashes(&mut self)
pub fn convert_to_hashes(&mut self)
Converts self
into Hashes
.
Sourcepub fn into_hashes(self) -> Self
pub fn into_hashes(self) -> Self
Converts self
into Hashes
.
Sourcepub fn iter(&self) -> BlockTransactionHashes<'_, T> ⓘ
👎Deprecated: use hashes
instead
pub fn iter(&self) -> BlockTransactionHashes<'_, T> ⓘ
hashes
insteadReturns an iterator over the transaction hashes.
Sourcepub fn hashes(&self) -> BlockTransactionHashes<'_, T> ⓘ
pub fn hashes(&self) -> BlockTransactionHashes<'_, T> ⓘ
Returns an iterator over references to the transaction hashes.
Trait Implementations§
Source§impl<T: Clone> Clone for BlockTransactions<T>
impl<T: Clone> Clone for BlockTransactions<T>
Source§fn clone(&self) -> BlockTransactions<T>
fn clone(&self) -> BlockTransactions<T>
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<T: Debug> Debug for BlockTransactions<T>
impl<T: Debug> Debug for BlockTransactions<T>
Source§impl<T> Default for BlockTransactions<T>
impl<T> Default for BlockTransactions<T>
Source§impl<'de, T> Deserialize<'de> for BlockTransactions<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for BlockTransactions<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> From<Vec<FixedBytes<32>>> for BlockTransactions<T>
impl<T> From<Vec<FixedBytes<32>>> for BlockTransactions<T>
Source§impl<T: TransactionResponse> From<Vec<T>> for BlockTransactions<T>
impl<T: TransactionResponse> From<Vec<T>> for BlockTransactions<T>
Source§impl<T: PartialEq> PartialEq for BlockTransactions<T>
impl<T: PartialEq> PartialEq for BlockTransactions<T>
Source§impl<T> Serialize for BlockTransactions<T>where
T: Serialize,
impl<T> Serialize for BlockTransactions<T>where
T: Serialize,
impl<T: Eq> Eq for BlockTransactions<T>
impl<T> StructuralPartialEq for BlockTransactions<T>
Auto Trait Implementations§
impl<T> Freeze for BlockTransactions<T>
impl<T> RefUnwindSafe for BlockTransactions<T>where
T: RefUnwindSafe,
impl<T> Send for BlockTransactions<T>where
T: Send,
impl<T> Sync for BlockTransactions<T>where
T: Sync,
impl<T> Unpin for BlockTransactions<T>where
T: Unpin,
impl<T> UnwindSafe for BlockTransactions<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)