Enum ethp2p::EthMessage
source · [−]pub enum EthMessage {
Show 15 variants
Status(Status),
NewBlockHashes(NewBlockHashes),
NewBlock(Box<NewBlock>),
Transactions(Transactions),
NewPooledTransactionHashes(NewPooledTransactionHashes),
GetBlockHeaders(RequestPair<GetBlockHeaders>),
BlockHeaders(RequestPair<BlockHeaders>),
GetBlockBodies(RequestPair<GetBlockBodies>),
BlockBodies(RequestPair<BlockBodies>),
GetPooledTransactions(RequestPair<GetPooledTransactions>),
PooledTransactions(RequestPair<PooledTransactions>),
GetNodeData(RequestPair<GetNodeData>),
NodeData(RequestPair<NodeData>),
GetReceipts(RequestPair<GetReceipts>),
Receipts(RequestPair<Receipts>),
}
Expand description
Represents a message in the eth wire protocol, versions 66 and 67.
The ethereum wire protocol is a set of messages that are broadcasted to the network in two styles:
- A request message sent by a peer (such as
GetPooledTransactions
), and an associated response message (such asPooledTransactions
). - A message that is broadcast to the network, without a corresponding request.
The newer eth/66
is an efficiency upgrade on top of eth/65
, introducing a request id to
correlate request-response message pairs. This allows for request multiplexing.
Variants
Status(Status)
NewBlockHashes(NewBlockHashes)
NewBlock(Box<NewBlock>)
Transactions(Transactions)
NewPooledTransactionHashes(NewPooledTransactionHashes)
GetBlockHeaders(RequestPair<GetBlockHeaders>)
BlockHeaders(RequestPair<BlockHeaders>)
GetBlockBodies(RequestPair<GetBlockBodies>)
BlockBodies(RequestPair<BlockBodies>)
GetPooledTransactions(RequestPair<GetPooledTransactions>)
PooledTransactions(RequestPair<PooledTransactions>)
GetNodeData(RequestPair<GetNodeData>)
NodeData(RequestPair<NodeData>)
GetReceipts(RequestPair<GetReceipts>)
Receipts(RequestPair<Receipts>)
Implementations
sourceimpl EthMessage
impl EthMessage
sourcepub fn message_id(&self) -> EthMessageID
pub fn message_id(&self) -> EthMessageID
Returns the message’s ID.
Trait Implementations
sourceimpl Clone for EthMessage
impl Clone for EthMessage
sourcefn clone(&self) -> EthMessage
fn clone(&self) -> EthMessage
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for EthMessage
impl Debug for EthMessage
sourceimpl Encodable for EthMessage
impl Encodable for EthMessage
sourceimpl From<EthMessage> for ProtocolMessage
impl From<EthMessage> for ProtocolMessage
sourcefn from(message: EthMessage) -> Self
fn from(message: EthMessage) -> Self
Converts to this type from the input type.
sourceimpl From<NewBlockHashes> for EthMessage
impl From<NewBlockHashes> for EthMessage
sourcefn from(t: NewBlockHashes) -> Self
fn from(t: NewBlockHashes) -> Self
Converts to this type from the input type.
sourceimpl From<NewPooledTransactionHashes> for EthMessage
impl From<NewPooledTransactionHashes> for EthMessage
sourcefn from(t: NewPooledTransactionHashes) -> Self
fn from(t: NewPooledTransactionHashes) -> Self
Converts to this type from the input type.
sourceimpl From<RequestPair<BlockBodies>> for EthMessage
impl From<RequestPair<BlockBodies>> for EthMessage
sourcefn from(t: RequestPair<BlockBodies>) -> Self
fn from(t: RequestPair<BlockBodies>) -> Self
Converts to this type from the input type.
sourceimpl From<RequestPair<BlockHeaders>> for EthMessage
impl From<RequestPair<BlockHeaders>> for EthMessage
sourcefn from(t: RequestPair<BlockHeaders>) -> Self
fn from(t: RequestPair<BlockHeaders>) -> Self
Converts to this type from the input type.
sourceimpl From<RequestPair<GetBlockBodies>> for EthMessage
impl From<RequestPair<GetBlockBodies>> for EthMessage
sourcefn from(t: RequestPair<GetBlockBodies>) -> Self
fn from(t: RequestPair<GetBlockBodies>) -> Self
Converts to this type from the input type.
sourceimpl From<RequestPair<GetBlockHeaders>> for EthMessage
impl From<RequestPair<GetBlockHeaders>> for EthMessage
sourcefn from(t: RequestPair<GetBlockHeaders>) -> Self
fn from(t: RequestPair<GetBlockHeaders>) -> Self
Converts to this type from the input type.
sourceimpl From<RequestPair<GetNodeData>> for EthMessage
impl From<RequestPair<GetNodeData>> for EthMessage
sourcefn from(t: RequestPair<GetNodeData>) -> Self
fn from(t: RequestPair<GetNodeData>) -> Self
Converts to this type from the input type.
sourceimpl From<RequestPair<GetPooledTransactions>> for EthMessage
impl From<RequestPair<GetPooledTransactions>> for EthMessage
sourcefn from(t: RequestPair<GetPooledTransactions>) -> Self
fn from(t: RequestPair<GetPooledTransactions>) -> Self
Converts to this type from the input type.
sourceimpl From<RequestPair<GetReceipts>> for EthMessage
impl From<RequestPair<GetReceipts>> for EthMessage
sourcefn from(t: RequestPair<GetReceipts>) -> Self
fn from(t: RequestPair<GetReceipts>) -> Self
Converts to this type from the input type.
sourceimpl From<RequestPair<NodeData>> for EthMessage
impl From<RequestPair<NodeData>> for EthMessage
sourcefn from(t: RequestPair<NodeData>) -> Self
fn from(t: RequestPair<NodeData>) -> Self
Converts to this type from the input type.
sourceimpl From<RequestPair<PooledTransactions>> for EthMessage
impl From<RequestPair<PooledTransactions>> for EthMessage
sourcefn from(t: RequestPair<PooledTransactions>) -> Self
fn from(t: RequestPair<PooledTransactions>) -> Self
Converts to this type from the input type.
sourceimpl From<RequestPair<Receipts>> for EthMessage
impl From<RequestPair<Receipts>> for EthMessage
sourcefn from(t: RequestPair<Receipts>) -> Self
fn from(t: RequestPair<Receipts>) -> Self
Converts to this type from the input type.
sourceimpl From<Status> for EthMessage
impl From<Status> for EthMessage
sourceimpl From<Transactions> for EthMessage
impl From<Transactions> for EthMessage
sourcefn from(t: Transactions) -> Self
fn from(t: Transactions) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<EthMessage> for EthMessage
impl PartialEq<EthMessage> for EthMessage
sourcefn eq(&self, other: &EthMessage) -> bool
fn eq(&self, other: &EthMessage) -> bool
impl Eq for EthMessage
impl StructuralEq for EthMessage
impl StructuralPartialEq for EthMessage
Auto Trait Implementations
impl RefUnwindSafe for EthMessage
impl Send for EthMessage
impl Sync for EthMessage
impl Unpin for EthMessage
impl UnwindSafe for EthMessage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more