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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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>,
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: 64 bytes