pub struct ResolvedDht {
pub per_peer_rate_per_sec: f64,
pub per_peer_burst: u32,
pub per_ip_rate_per_sec: f64,
pub per_ip_burst: u32,
pub global_rate_per_sec: f64,
pub global_burst: u32,
pub max_tracked_per_ip: usize,
pub max_tracked_per_peer: usize,
}Expand description
Resolved cdn/dht/v1 settings (ADR 022).
Each *_rate_per_sec == 0.0 and matching *_burst == 0 disables that
layer. The resolver guarantees every rate is finite and >= 0, and that
each *_burst > 0 whenever its rate is > 0 (no deny-all).
Default returns the ADR 022 §DHT Rate Limiting defaults so test sites
that build a ResolvedConfig by hand can write ResolvedDht::default()
instead of restating the constants. The production resolve_dht_into
path threads the defaults through the resolver bag and is what
decdn-common’s integration tests cover.
Fields§
§per_peer_rate_per_sec: f64Token refill rate for the per-peer (NodeId) limiter, in requests/second.
per_peer_burst: u32Bucket capacity for the per-peer limiter: how many requests one
peer may send back to back before the refill rate binds. 0 alongside
a 0.0 rate disables the layer; 0 against a nonzero rate is rejected
as a deny-all. The same pairing rule holds for the two below.
per_ip_rate_per_sec: f64Token refill rate for the per-source-IP limiter, in requests/second.
per_ip_burst: u32Bucket capacity for the per-IP limiter.
global_rate_per_sec: f64Token refill rate for the handler-wide limiter, in requests/second. Applies across all peers and all source IPs together.
global_burst: u32Bucket capacity for the handler-wide limiter.
max_tracked_per_ip: usizeHard cap on the per-IP keyed-limiter map (#645). 0 => unbounded.
max_tracked_per_peer: usizeHard cap on the per-peer (NodeId) keyed-limiter map (#645). 0
=> unbounded.
Trait Implementations§
Source§impl Clone for ResolvedDht
impl Clone for ResolvedDht
Source§impl Debug for ResolvedDht
impl Debug for ResolvedDht
Auto Trait Implementations§
impl Freeze for ResolvedDht
impl RefUnwindSafe for ResolvedDht
impl Send for ResolvedDht
impl Sync for ResolvedDht
impl Unpin for ResolvedDht
impl UnsafeUnpin for ResolvedDht
impl UnwindSafe for ResolvedDht
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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