Struct reth_discv4::Discv4ConfigBuilder

source ·
pub struct Discv4ConfigBuilder { /* private fields */ }
Expand description

Builder type for Discv4Config

Implementations§

source§

impl Discv4ConfigBuilder

source

pub fn enable_packet_filter(&mut self) -> &mut Self

Whether to enable the incoming packet filter.

source

pub fn udp_ingress_message_buffer( &mut self, udp_ingress_message_buffer: usize, ) -> &mut Self

Sets the channel size for incoming messages

source

pub fn udp_egress_message_buffer( &mut self, udp_egress_message_buffer: usize, ) -> &mut Self

Sets the channel size for outgoing messages

source

pub fn max_find_node_failures( &mut self, max_find_node_failures: u8, ) -> &mut Self

The number of allowed request failures for findNode requests.

source

pub fn ping_interval(&mut self, interval: Duration) -> &mut Self

The time between pings to ensure connectivity amongst connected nodes.

source

pub fn request_timeout(&mut self, duration: Duration) -> &mut Self

Sets the timeout after which requests are considered timed out

source

pub fn ping_expiration(&mut self, duration: Duration) -> &mut Self

Sets the expiration duration for pings

source

pub fn enr_request_expiration(&mut self, duration: Duration) -> &mut Self

Sets the expiration duration for enr requests

source

pub fn lookup_neighbours_expiration(&mut self, duration: Duration) -> &mut Self

Sets the expiration duration for lookup neighbor requests

source

pub fn bond_expiration(&mut self, duration: Duration) -> &mut Self

Sets the expiration duration for a bond with a peer

source

pub fn enable_dht_random_walk( &mut self, enable_dht_random_walk: bool, ) -> &mut Self

Whether to discover random nodes in the DHT.

source

pub fn enable_lookup(&mut self, enable_lookup: bool) -> &mut Self

Whether to automatically lookup

source

pub fn enable_eip868(&mut self, enable_eip868: bool) -> &mut Self

Whether to enforce expiration timestamps in messages.

source

pub fn enforce_expiration_timestamps( &mut self, enforce_expiration_timestamps: bool, ) -> &mut Self

Whether to enable EIP-868

source

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

source

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

source

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

source

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].

source

pub fn lookup_interval(&mut self, lookup_interval: Duration) -> &mut Self

Sets the lookup interval duration.

source

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.

source

pub fn add_boot_node(&mut self, node: NodeRecord) -> &mut Self

Adds a boot node

source

pub fn add_boot_nodes( &mut self, nodes: impl IntoIterator<Item = NodeRecord>, ) -> &mut Self

Adds multiple boot nodes

source

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.

source

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.

source

pub fn build(&self) -> Discv4Config

Returns the configured Discv4Config

Trait Implementations§

source§

impl Clone for Discv4ConfigBuilder

source§

fn clone(&self) -> Discv4ConfigBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Discv4ConfigBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Discv4ConfigBuilder

source§

fn default() -> Discv4ConfigBuilder

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Discv4ConfigBuilder

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Discv4ConfigBuilder

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit #126799)
Performs copy-assignment from self to dst. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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