Struct reth_network_types::peers::config::PeerBackoffDurations
source · pub struct PeerBackoffDurations {
pub low: Duration,
pub medium: Duration,
pub high: Duration,
pub max: Duration,
}
Expand description
The durations to use when a backoff should be applied to a peer.
See also BackoffKind
.
Fields§
§low: Duration
Applies to connection problems where there is a chance that they will be resolved after the short duration.
medium: Duration
Applies to more severe connection problems where there is a lower chance that they will be resolved.
high: Duration
Intended for spammers, or bad peers in general.
max: Duration
Maximum total backoff duration.
Implementations§
source§impl PeerBackoffDurations
impl PeerBackoffDurations
sourcepub const fn backoff(&self, kind: BackoffKind) -> Duration
pub const fn backoff(&self, kind: BackoffKind) -> Duration
Returns the corresponding Duration
sourcepub fn backoff_until(&self, kind: BackoffKind, backoff_counter: u8) -> Instant
pub fn backoff_until(&self, kind: BackoffKind, backoff_counter: u8) -> Instant
Returns the timestamp until which we should backoff.
The Backoff duration is capped by the configured maximum backoff duration.
Trait Implementations§
source§impl Clone for PeerBackoffDurations
impl Clone for PeerBackoffDurations
source§fn clone(&self) -> PeerBackoffDurations
fn clone(&self) -> PeerBackoffDurations
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PeerBackoffDurations
impl Debug for PeerBackoffDurations
source§impl Default for PeerBackoffDurations
impl Default for PeerBackoffDurations
source§impl<'de> Deserialize<'de> for PeerBackoffDurations
impl<'de> Deserialize<'de> for PeerBackoffDurations
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 PartialEq for PeerBackoffDurations
impl PartialEq for PeerBackoffDurations
source§impl Serialize for PeerBackoffDurations
impl Serialize for PeerBackoffDurations
impl Copy for PeerBackoffDurations
impl Eq for PeerBackoffDurations
impl StructuralPartialEq for PeerBackoffDurations
Auto Trait Implementations§
impl Freeze for PeerBackoffDurations
impl RefUnwindSafe for PeerBackoffDurations
impl Send for PeerBackoffDurations
impl Sync for PeerBackoffDurations
impl Unpin for PeerBackoffDurations
impl UnwindSafe for PeerBackoffDurations
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>
§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>,
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: 64 bytes