Enum EthBroadcastMessage
pub enum EthBroadcastMessage<N = BasicNetworkPrimitives<EthPrimitives, EthereumTxEnvelope<TxEip4844WithSidecar>>>where
N: NetworkPrimitives,{
NewBlock(Arc<<N as NetworkPrimitives>::NewBlockPayload>),
Transactions(SharedTransactions<<N as NetworkPrimitives>::BroadcastedTransaction>),
BroadcastPoolTransactions(BroadcastPoolTransactions),
}Expand description
Represents broadcast messages of EthMessage with the same object that can be sent to
multiple peers.
Messages that contain a list of hashes depend on the peer the message is sent to. A peer should never receive a hash of an object (block, transaction) it has already seen.
Note: This is only useful for outgoing messages.
Variants§
NewBlock(Arc<<N as NetworkPrimitives>::NewBlockPayload>)
Represents a new block broadcast message.
Transactions(SharedTransactions<<N as NetworkPrimitives>::BroadcastedTransaction>)
Represents a transactions broadcast message.
BroadcastPoolTransactions(BroadcastPoolTransactions)
Represents cached outbound pool transactions broadcast message.
Implementations§
§impl<N> EthBroadcastMessage<N>where
N: NetworkPrimitives,
impl<N> EthBroadcastMessage<N>where
N: NetworkPrimitives,
pub const fn message_id(&self) -> EthMessageID
pub const fn message_id(&self) -> EthMessageID
Returns the message’s ID.
pub fn encoded(self) -> Bytes
pub fn encoded(self) -> Bytes
Encodes this broadcast to its id-prefixed RLPx message bytes.
Trait Implementations§
§impl<N> Clone for EthBroadcastMessage<N>where
N: Clone + NetworkPrimitives,
<N as NetworkPrimitives>::NewBlockPayload: Clone,
<N as NetworkPrimitives>::BroadcastedTransaction: Clone,
impl<N> Clone for EthBroadcastMessage<N>where
N: Clone + NetworkPrimitives,
<N as NetworkPrimitives>::NewBlockPayload: Clone,
<N as NetworkPrimitives>::BroadcastedTransaction: Clone,
§fn clone(&self) -> EthBroadcastMessage<N>
fn clone(&self) -> EthBroadcastMessage<N>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<N> Debug for EthBroadcastMessage<N>where
N: Debug + NetworkPrimitives,
<N as NetworkPrimitives>::NewBlockPayload: Debug,
<N as NetworkPrimitives>::BroadcastedTransaction: Debug,
impl<N> Debug for EthBroadcastMessage<N>where
N: Debug + NetworkPrimitives,
<N as NetworkPrimitives>::NewBlockPayload: Debug,
<N as NetworkPrimitives>::BroadcastedTransaction: Debug,
§impl<N> Encodable for EthBroadcastMessage<N>where
N: NetworkPrimitives,
impl<N> Encodable for EthBroadcastMessage<N>where
N: NetworkPrimitives,
§impl<N> From<EthBroadcastMessage<N>> for ProtocolBroadcastMessage<N>where
N: NetworkPrimitives,
impl<N> From<EthBroadcastMessage<N>> for ProtocolBroadcastMessage<N>where
N: NetworkPrimitives,
§fn from(message: EthBroadcastMessage<N>) -> ProtocolBroadcastMessage<N>
fn from(message: EthBroadcastMessage<N>) -> ProtocolBroadcastMessage<N>
Auto Trait Implementations§
impl<N = BasicNetworkPrimitives<EthPrimitives, EthereumTxEnvelope<TxEip4844WithSidecar>>> !RefUnwindSafe for EthBroadcastMessage<N>
impl<N = BasicNetworkPrimitives<EthPrimitives, EthereumTxEnvelope<TxEip4844WithSidecar>>> !UnwindSafe for EthBroadcastMessage<N>
impl<N> Freeze for EthBroadcastMessage<N>where
Arc<<N as NetworkPrimitives>::NewBlockPayload>: Freeze,
SharedTransactions<<N as NetworkPrimitives>::BroadcastedTransaction>: Freeze,
impl<N> Send for EthBroadcastMessage<N>where
Arc<<N as NetworkPrimitives>::NewBlockPayload>: Send,
SharedTransactions<<N as NetworkPrimitives>::BroadcastedTransaction>: Send,
impl<N> Sync for EthBroadcastMessage<N>where
Arc<<N as NetworkPrimitives>::NewBlockPayload>: Sync,
SharedTransactions<<N as NetworkPrimitives>::BroadcastedTransaction>: Sync,
impl<N> Unpin for EthBroadcastMessage<N>where
Arc<<N as NetworkPrimitives>::NewBlockPayload>: Unpin,
SharedTransactions<<N as NetworkPrimitives>::BroadcastedTransaction>: Unpin,
impl<N> UnsafeUnpin for EthBroadcastMessage<N>where
Arc<<N as NetworkPrimitives>::NewBlockPayload>: UnsafeUnpin,
SharedTransactions<<N as NetworkPrimitives>::BroadcastedTransaction>: UnsafeUnpin,
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> 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 more§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: 32 bytes
Size for each variant:
NewBlock: 8 bytesTransactions: 24 bytesBroadcastPoolTransactions: 24 bytes