pub struct HelloMessageBuilder {
pub protocol_version: Option<ProtocolVersion>,
pub client_version: Option<String>,
pub protocols: Option<Vec<Protocol>>,
pub port: Option<u16>,
pub id: PeerId,
}Expand description
Builder for HelloMessageWithProtocols
Fields§
§protocol_version: Option<ProtocolVersion>The version of the p2p protocol.
client_version: Option<String>Specifies the client software identity, as a human-readable string (e.g. “Ethereum(++)/1.0.0”).
protocols: Option<Vec<Protocol>>The list of supported protocols.
port: Option<u16>The 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 HelloMessageBuilder
impl HelloMessageBuilder
Sourcepub const fn new(id: PeerId) -> Self
pub const fn new(id: PeerId) -> Self
Create a new builder to configure a HelloMessage
Sourcepub fn protocols(self, protocols: impl IntoIterator<Item = Protocol>) -> Self
pub fn protocols(self, protocols: impl IntoIterator<Item = Protocol>) -> Self
Sets protocols to use.
Sourcepub fn client_version(self, client_version: impl Into<String>) -> Self
pub fn client_version(self, client_version: impl Into<String>) -> Self
Sets client version.
Sourcepub const fn protocol_version(self, protocol_version: ProtocolVersion) -> Self
pub const fn protocol_version(self, protocol_version: ProtocolVersion) -> Self
Sets protocol version.
Sourcepub fn build(self) -> HelloMessageWithProtocols
pub fn build(self) -> HelloMessageWithProtocols
Consumes the type and returns the configured HelloMessage
Unset fields will be set to their default values:
protocol_version:ProtocolVersion::V5client_version: [RETH_CLIENT_VERSION]capabilities: AllEthVersion
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HelloMessageBuilder
impl RefUnwindSafe for HelloMessageBuilder
impl Send for HelloMessageBuilder
impl Sync for HelloMessageBuilder
impl Unpin for HelloMessageBuilder
impl UnsafeUnpin for HelloMessageBuilder
impl UnwindSafe for HelloMessageBuilder
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
§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: 120 bytes