pub struct HelloMessage {
pub protocol_version: ProtocolVersion,
pub client_version: String,
pub capabilities: Vec<Capability>,
pub port: u16,
pub id: PeerId,
}Expand description
Raw rlpx protocol message used in the p2p handshake, containing information about the
supported RLPx protocol version and capabilities.
Decoding ignores list elements after id, which the spec reserves for future versions (EIP-8).
See also https://github.com/ethereum/devp2p/blob/master/rlpx.md#hello-0x00
Fields§
§protocol_version: ProtocolVersionThe version of the p2p protocol.
client_version: StringSpecifies the client software identity, as a human-readable string (e.g. “Ethereum(++)/1.0.0”).
capabilities: Vec<Capability>The list of supported capabilities and their versions.
port: u16The port that the client is listening on, zero indicates the client is not listening.
id: PeerIdThe secp256k1 public key corresponding to the node’s private key.
Implementations§
Source§impl HelloMessage
impl HelloMessage
Sourcepub const fn builder(id: PeerId) -> HelloMessageBuilder
pub const fn builder(id: PeerId) -> HelloMessageBuilder
Starts a new HelloMessageBuilder
use reth_eth_wire::HelloMessage;
use reth_network_peers::pk2id;
use secp256k1::SecretKey;
let secret_key = SecretKey::new(&mut rand::rng());
let id = pk2id(&secret_key.public_key());
let status = HelloMessage::builder(id).build();Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for HelloMessage
impl<'arbitrary> Arbitrary<'arbitrary> for HelloMessage
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self from the entirety of the given
unstructured data. Read moreSource§impl Clone for HelloMessage
impl Clone for HelloMessage
Source§impl Debug for HelloMessage
impl Debug for HelloMessage
Source§impl Decodable for HelloMessage
impl Decodable for HelloMessage
Source§impl<'de> Deserialize<'de> for HelloMessage
impl<'de> Deserialize<'de> for HelloMessage
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 HelloMessage
impl Encodable for HelloMessage
impl Eq for HelloMessage
Source§impl PartialEq for HelloMessage
impl PartialEq for HelloMessage
Source§impl Serialize for HelloMessage
impl Serialize for HelloMessage
impl StructuralPartialEq for HelloMessage
Auto Trait Implementations§
impl Freeze for HelloMessage
impl RefUnwindSafe for HelloMessage
impl Send for HelloMessage
impl Sync for HelloMessage
impl Unpin for HelloMessage
impl UnsafeUnpin for HelloMessage
impl UnwindSafe for HelloMessage
Blanket Implementations§
impl<A> ArbInterop for A
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: 120 bytes