pub struct Config { /* private fields */ }Expand description
Config used to bootstrap [discv5::Discv5].
Implementations§
Source§impl Config
impl Config
Sourcepub fn builder(rlpx_tcp_socket: SocketAddr) -> ConfigBuilder
pub fn builder(rlpx_tcp_socket: SocketAddr) -> ConfigBuilder
Returns a new ConfigBuilder, with the RLPx TCP port and IP version configured w.r.t.
the given socket.
Sourcepub const fn discv5_config_mut(&mut self) -> &mut Config
pub const fn discv5_config_mut(&mut self) -> &mut Config
Returns a mutable reference to the inner [discv5::Config]. This allows overriding
the listen config after the config has been built.
Sourcepub fn has_matching_socket(&self, addr: SocketAddr) -> bool
pub fn has_matching_socket(&self, addr: SocketAddr) -> bool
Returns true if any socket in the discv5 listen config matches the given address.
Sourcepub fn insert_boot_node(&mut self, boot_node: BootNode)
pub fn insert_boot_node(&mut self, boot_node: BootNode)
Inserts a new boot node to the list of boot nodes.
Sourcepub fn insert_unsigned_boot_node(&mut self, node_record: NodeRecord)
pub fn insert_unsigned_boot_node(&mut self, node_record: NodeRecord)
Inserts a new unsigned enode boot node to the list of boot nodes if it can be parsed, see
also BootNode::from_unsigned.
Sourcepub fn extend_unsigned_boot_nodes(
&mut self,
node_records: impl IntoIterator<Item = NodeRecord>,
)
pub fn extend_unsigned_boot_nodes( &mut self, node_records: impl IntoIterator<Item = NodeRecord>, )
Extends the list of boot nodes with a list of enode boot nodes if they can be parsed.
Sourcepub fn discovery_socket(&self) -> SocketAddr
pub fn discovery_socket(&self) -> SocketAddr
Returns the discovery (UDP) socket contained in the [discv5::Config]. Returns the IPv6
socket, if both IPv4 and v6 are configured. This socket will be advertised to peers in the
local Enr.
Sourcepub const fn rlpx_socket(&self) -> &SocketAddr
pub const fn rlpx_socket(&self) -> &SocketAddr
Returns the RLPx (TCP) socket contained in the [discv5::Config]. This socket will be
advertised to peers in the local Enr.
Sourcepub const fn set_rlpx_port(&mut self, port: u16)
pub const fn set_rlpx_port(&mut self, port: u16)
Sets the port of the RLPx TCP socket to advertise. This allows advertising the actually
bound listener port when the configured port was 0 (OS-assigned).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Config
impl !UnwindSafe for Config
impl Freeze for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
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: 864 bytes