Enum BlockTransactions
pub enum BlockTransactions<T> {
Full(Vec<T>),
Hashes(Vec<FixedBytes<32>>),
Uncle,
}
Expand description
Block Transactions depending on the boolean attribute of eth_getBlockBy*
,
or if used by eth_getUncle*
Variants§
Full(Vec<T>)
Full transactions
Hashes(Vec<FixedBytes<32>>)
Only hashes
Uncle
Special case for uncle response.
Implementations§
§impl<T> BlockTransactions<T>
impl<T> BlockTransactions<T>
pub 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
.
pub 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.
pub 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.
pub const fn uncle() -> BlockTransactions<T>
pub const fn uncle() -> BlockTransactions<T>
Returns an instance of BlockTransactions with the Uncle special case.
§impl<T> BlockTransactions<T>where
T: TransactionResponse,
impl<T> BlockTransactions<T>where
T: TransactionResponse,
pub fn convert_to_hashes(&mut self)
pub fn convert_to_hashes(&mut self)
Converts self
into Hashes
.
pub fn into_hashes(self) -> BlockTransactions<T>
pub fn into_hashes(self) -> BlockTransactions<T>
Converts self
into Hashes
.
pub fn iter(&self) -> BlockTransactionHashes<'_, T> ⓘ
👎Deprecated: use hashes
instead
pub fn iter(&self) -> BlockTransactionHashes<'_, T> ⓘ
hashes
insteadReturns an iterator over the transaction hashes.
pub fn hashes(&self) -> BlockTransactionHashes<'_, T> ⓘ
pub fn hashes(&self) -> BlockTransactionHashes<'_, T> ⓘ
Returns an iterator over references to the transaction hashes.
Trait Implementations§
§impl<T> Clone for BlockTransactions<T>where
T: Clone,
impl<T> Clone for BlockTransactions<T>where
T: Clone,
§fn clone(&self) -> BlockTransactions<T>
fn clone(&self) -> BlockTransactions<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl<T> Debug for BlockTransactions<T>where
T: Debug,
impl<T> Debug for BlockTransactions<T>where
T: Debug,
§impl<T> Default for BlockTransactions<T>
impl<T> Default for BlockTransactions<T>
§fn default() -> BlockTransactions<T>
fn default() -> BlockTransactions<T>
§impl<'de, T> Deserialize<'de> for BlockTransactions<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for BlockTransactions<T>where
T: Deserialize<'de>,
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BlockTransactions<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BlockTransactions<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl<T> From<Vec<FixedBytes<32>>> for BlockTransactions<T>
impl<T> From<Vec<FixedBytes<32>>> for BlockTransactions<T>
§fn from(hashes: Vec<FixedBytes<32>>) -> BlockTransactions<T>
fn from(hashes: Vec<FixedBytes<32>>) -> BlockTransactions<T>
§impl<T> From<Vec<T>> for BlockTransactions<T>where
T: TransactionResponse,
impl<T> From<Vec<T>> for BlockTransactions<T>where
T: TransactionResponse,
§fn from(transactions: Vec<T>) -> BlockTransactions<T>
fn from(transactions: Vec<T>) -> BlockTransactions<T>
§impl<T> PartialEq for BlockTransactions<T>where
T: PartialEq,
impl<T> PartialEq for BlockTransactions<T>where
T: PartialEq,
§impl<T> Serialize for BlockTransactions<T>where
T: Serialize,
impl<T> Serialize for BlockTransactions<T>where
T: Serialize,
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl<T> Eq for BlockTransactions<T>where
T: Eq,
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
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)
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> RpcObject for Twhere
T: RpcParam + RpcReturn,
impl<T> RpcParam for T
impl<T> RpcReturn for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes
Size for each variant:
Full
: 24 bytesHashes
: 24 bytesUncle
: 0 bytes