pub struct NewPooledTransactionHashes68 {
pub types: Vec<u8>,
pub sizes: Vec<usize>,
pub hashes: Vec<B256>,
}Expand description
Same as NewPooledTransactionHashes66 but extends that beside the transaction hashes,
the node sends the transaction types and their sizes (as defined in EIP-2718) as well.
Fields§
§types: Vec<u8>Transaction types for new transactions that have appeared on the network.
§Note on RLP encoding and decoding
In the eth/68 spec this is defined the following way:
[type_0: B_1, type_1: B_1, ...]
This would make it seem like the [Encodable] and
[Decodable] implementations should directly use a Vec<u8> for
encoding and decoding, because it looks like this field should be encoded as a list of
bytes.
However, this is implemented in geth as a []byte
type,
which ends up being encoded as a RLP
string,
not a RLP list.
Because of this, we do not directly use the Vec<u8> when encoding and decoding, and
instead use the [Encodable] and [Decodable]
implementations for &[u8] instead, which encodes into a RLP string, and expects an RLP
string when decoding.
sizes: Vec<usize>Transaction sizes for new transactions that have appeared on the network.
hashes: Vec<B256>Transaction hashes for new transactions that have appeared on the network.
Implementations§
Source§impl NewPooledTransactionHashes68
impl NewPooledTransactionHashes68
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Returns a new instance with capacity for capacity entries.
Sourcepub fn metadata_iter(&self) -> impl Iterator<Item = (&B256, (u8, usize))>
pub fn metadata_iter(&self) -> impl Iterator<Item = (&B256, (u8, usize))>
Returns an iterator over tx hashes zipped with corresponding metadata.
Sourcepub fn extend<'a, T: SignedTransaction>(
&mut self,
txs: impl IntoIterator<Item = &'a T>,
)
pub fn extend<'a, T: SignedTransaction>( &mut self, txs: impl IntoIterator<Item = &'a T>, )
Appends the provided transactions
Sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of the message vectors as much as possible.
Sourcepub fn with_transaction<T: SignedTransaction>(self, tx: &T) -> Self
pub fn with_transaction<T: SignedTransaction>(self, tx: &T) -> Self
Consumes and appends a transaction
Sourcepub fn with_transactions<'a, T: SignedTransaction>(
self,
txs: impl IntoIterator<Item = &'a T>,
) -> Self
pub fn with_transactions<'a, T: SignedTransaction>( self, txs: impl IntoIterator<Item = &'a T>, ) -> Self
Consumes and appends the provided transactions
Trait Implementations§
Source§impl Arbitrary for NewPooledTransactionHashes68
Available on crate feature arbitrary only.
impl Arbitrary for NewPooledTransactionHashes68
arbitrary only.Source§type Parameters = ()
type Parameters = ()
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.Source§type Strategy = BoxedStrategy<NewPooledTransactionHashes68>
type Strategy = BoxedStrategy<NewPooledTransactionHashes68>
Strategy used to generate values of type Self.Source§fn arbitrary_with(_args: ()) -> Self::Strategy
fn arbitrary_with(_args: ()) -> Self::Strategy
Source§impl Clone for NewPooledTransactionHashes68
impl Clone for NewPooledTransactionHashes68
Source§impl Debug for NewPooledTransactionHashes68
impl Debug for NewPooledTransactionHashes68
Source§impl Decodable for NewPooledTransactionHashes68
impl Decodable for NewPooledTransactionHashes68
Source§impl<'de> Deserialize<'de> for NewPooledTransactionHashes68
Available on crate feature serde only.
impl<'de> Deserialize<'de> for NewPooledTransactionHashes68
serde only.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>,
Source§impl Encodable for NewPooledTransactionHashes68
impl Encodable for NewPooledTransactionHashes68
impl Eq for NewPooledTransactionHashes68
Source§impl From<NewPooledTransactionHashes68> for NewPooledTransactionHashes
impl From<NewPooledTransactionHashes68> for NewPooledTransactionHashes
Source§fn from(hashes: NewPooledTransactionHashes68) -> Self
fn from(hashes: NewPooledTransactionHashes68) -> Self
Source§impl Serialize for NewPooledTransactionHashes68
Available on crate feature serde only.
impl Serialize for NewPooledTransactionHashes68
serde only.impl StructuralPartialEq for NewPooledTransactionHashes68
Auto Trait Implementations§
impl Freeze for NewPooledTransactionHashes68
impl RefUnwindSafe for NewPooledTransactionHashes68
impl Send for NewPooledTransactionHashes68
impl Sync for NewPooledTransactionHashes68
impl Unpin for NewPooledTransactionHashes68
impl UnsafeUnpin for NewPooledTransactionHashes68
impl UnwindSafe for NewPooledTransactionHashes68
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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
key and return true if they are equal.§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> ⓘ
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 moreimpl<T> MaybeSerde for Twhere
T: Serialize + for<'de> Deserialize<'de>,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§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> ⓘ
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: 72 bytes