pub struct Discv4ConfigBuilder { /* private fields */ }
Expand description
Builder type for Discv4Config
Implementations§
Source§impl Discv4ConfigBuilder
impl Discv4ConfigBuilder
Sourcepub fn enable_packet_filter(&mut self) -> &mut Self
pub fn enable_packet_filter(&mut self) -> &mut Self
Whether to enable the incoming packet filter.
Sourcepub fn udp_ingress_message_buffer(
&mut self,
udp_ingress_message_buffer: usize,
) -> &mut Self
pub fn udp_ingress_message_buffer( &mut self, udp_ingress_message_buffer: usize, ) -> &mut Self
Sets the channel size for incoming messages
Sourcepub fn udp_egress_message_buffer(
&mut self,
udp_egress_message_buffer: usize,
) -> &mut Self
pub fn udp_egress_message_buffer( &mut self, udp_egress_message_buffer: usize, ) -> &mut Self
Sets the channel size for outgoing messages
Sourcepub fn max_find_node_failures(
&mut self,
max_find_node_failures: u8,
) -> &mut Self
pub fn max_find_node_failures( &mut self, max_find_node_failures: u8, ) -> &mut Self
The number of allowed request failures for findNode
requests.
Sourcepub fn ping_interval(&mut self, interval: Duration) -> &mut Self
pub fn ping_interval(&mut self, interval: Duration) -> &mut Self
The time between pings to ensure connectivity amongst connected nodes.
Sourcepub fn request_timeout(&mut self, duration: Duration) -> &mut Self
pub fn request_timeout(&mut self, duration: Duration) -> &mut Self
Sets the timeout after which requests are considered timed out
Sourcepub fn ping_expiration(&mut self, duration: Duration) -> &mut Self
pub fn ping_expiration(&mut self, duration: Duration) -> &mut Self
Sets the expiration duration for pings
Sourcepub fn enr_request_expiration(&mut self, duration: Duration) -> &mut Self
pub fn enr_request_expiration(&mut self, duration: Duration) -> &mut Self
Sets the expiration duration for enr requests
Sourcepub fn lookup_neighbours_expiration(&mut self, duration: Duration) -> &mut Self
pub fn lookup_neighbours_expiration(&mut self, duration: Duration) -> &mut Self
Sets the expiration duration for lookup neighbor requests
Sourcepub fn bond_expiration(&mut self, duration: Duration) -> &mut Self
pub fn bond_expiration(&mut self, duration: Duration) -> &mut Self
Sets the expiration duration for a bond with a peer
Sourcepub fn enable_dht_random_walk(
&mut self,
enable_dht_random_walk: bool,
) -> &mut Self
pub fn enable_dht_random_walk( &mut self, enable_dht_random_walk: bool, ) -> &mut Self
Whether to discover random nodes in the DHT.
Sourcepub fn enable_lookup(&mut self, enable_lookup: bool) -> &mut Self
pub fn enable_lookup(&mut self, enable_lookup: bool) -> &mut Self
Whether to automatically lookup
Sourcepub fn enable_eip868(&mut self, enable_eip868: bool) -> &mut Self
pub fn enable_eip868(&mut self, enable_eip868: bool) -> &mut Self
Whether to enforce expiration timestamps in messages.
Sourcepub fn enforce_expiration_timestamps(
&mut self,
enforce_expiration_timestamps: bool,
) -> &mut Self
pub fn enforce_expiration_timestamps( &mut self, enforce_expiration_timestamps: bool, ) -> &mut Self
Whether to enable EIP-868
Sourcepub fn add_eip868_pair(
&mut self,
key: impl Into<Vec<u8>>,
value: impl Encodable,
) -> &mut Self
pub fn add_eip868_pair( &mut self, key: impl Into<Vec<u8>>, value: impl Encodable, ) -> &mut Self
Add another key value pair to include in the ENR
Sourcepub fn add_eip868_rlp_pair(
&mut self,
key: impl Into<Vec<u8>>,
rlp: Bytes,
) -> &mut Self
pub fn add_eip868_rlp_pair( &mut self, key: impl Into<Vec<u8>>, rlp: Bytes, ) -> &mut Self
Add another key value pair to include in the ENR
Sourcepub fn extend_eip868_rlp_pairs(
&mut self,
pairs: impl IntoIterator<Item = (impl Into<Vec<u8>>, Bytes)>,
) -> &mut Self
pub fn extend_eip868_rlp_pairs( &mut self, pairs: impl IntoIterator<Item = (impl Into<Vec<u8>>, Bytes)>, ) -> &mut Self
Extend additional key value pairs to include in the ENR
Sourcepub fn ban_list(&mut self, ban_list: BanList) -> &mut Self
pub fn ban_list(&mut self, ban_list: BanList) -> &mut Self
A set of lists that can ban IP’s or PeerIds
from the server. See
[BanList
].
Sourcepub fn lookup_interval(&mut self, lookup_interval: Duration) -> &mut Self
pub fn lookup_interval(&mut self, lookup_interval: Duration) -> &mut Self
Sets the lookup interval duration.
Sourcepub fn ban_duration(&mut self, ban_duration: Option<Duration>) -> &mut Self
pub fn ban_duration(&mut self, ban_duration: Option<Duration>) -> &mut Self
Set the default duration for which nodes are banned for. This timeouts are checked every 5
minutes, so the precision will be to the nearest 5 minutes. If set to None
, bans from
the filter will last indefinitely. Default is 1 hour.
Sourcepub fn add_boot_node(&mut self, node: NodeRecord) -> &mut Self
pub fn add_boot_node(&mut self, node: NodeRecord) -> &mut Self
Adds a boot node
Sourcepub fn add_boot_nodes(
&mut self,
nodes: impl IntoIterator<Item = NodeRecord>,
) -> &mut Self
pub fn add_boot_nodes( &mut self, nodes: impl IntoIterator<Item = NodeRecord>, ) -> &mut Self
Adds multiple boot nodes
Sourcepub fn external_ip_resolver(
&mut self,
external_ip_resolver: Option<NatResolver>,
) -> &mut Self
pub fn external_ip_resolver( &mut self, external_ip_resolver: Option<NatResolver>, ) -> &mut Self
Configures if and how the external IP of the node should be resolved.
Sourcepub fn resolve_external_ip_interval(
&mut self,
resolve_external_ip_interval: Option<Duration>,
) -> &mut Self
pub fn resolve_external_ip_interval( &mut self, resolve_external_ip_interval: Option<Duration>, ) -> &mut Self
Sets the interval at which the external IP is to be resolved.
Sourcepub fn build(&self) -> Discv4Config
pub fn build(&self) -> Discv4Config
Returns the configured Discv4Config
Trait Implementations§
Source§impl Clone for Discv4ConfigBuilder
impl Clone for Discv4ConfigBuilder
Source§fn clone(&self) -> Discv4ConfigBuilder
fn clone(&self) -> Discv4ConfigBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for Discv4ConfigBuilder
impl Debug for Discv4ConfigBuilder
Source§impl Default for Discv4ConfigBuilder
impl Default for Discv4ConfigBuilder
Source§fn default() -> Discv4ConfigBuilder
fn default() -> Discv4ConfigBuilder
Source§impl<'de> Deserialize<'de> for Discv4ConfigBuilder
impl<'de> Deserialize<'de> for Discv4ConfigBuilder
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>,
Auto Trait Implementations§
impl Freeze for Discv4ConfigBuilder
impl RefUnwindSafe for Discv4ConfigBuilder
impl Send for Discv4ConfigBuilder
impl Sync for Discv4ConfigBuilder
impl Unpin for Discv4ConfigBuilder
impl UnwindSafe for Discv4ConfigBuilder
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
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>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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> 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>
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
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: 376 bytes