pub struct NeighborsConfig {
pub update_interval: Duration,
pub ping_interval: Duration,
pub apply_score_interval: Duration,
pub update_metrics_interval: Duration,
pub keep: usize,
pub max_ping_tasks: usize,
pub default_roundtrip: Duration,
pub send_timeout: Duration,
pub query_timeout: Duration,
pub enable_metrics: bool,
}Fields§
§update_interval: DurationThe interval at which neighbours list is updated.
Default: 2 minutes.
ping_interval: DurationThe interval at which current neighbours are pinged.
Default: 30 seconds.
apply_score_interval: DurationThe interval at which neighbours score is applied to selection index.
Default: 10 seconds.
update_metrics_interval: DurationThe interval to export neighbours metrics.
Default: 5 seconds.
keep: usizeThe maximum number of neighbours to keep.
Default: 5.
max_ping_tasks: usizeThe maximum number of ping tasks to run concurrently.
Default: 5.
default_roundtrip: DurationThe default roundtrip time to use when a neighbour is added.
Default: 300 ms.
send_timeout: DurationSend timeout (unidirectional).
Default: 500ms.
query_timeout: DurationQuery timeout (bidirectional).
Default: 1s.
enable_metrics: boolWhether to enable Neighbours metrics.
Default: true.
Trait Implementations§
Source§impl Clone for NeighborsConfig
impl Clone for NeighborsConfig
Source§fn clone(&self) -> NeighborsConfig
fn clone(&self) -> NeighborsConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NeighborsConfig
impl Debug for NeighborsConfig
Source§impl Default for NeighborsConfig
impl Default for NeighborsConfig
Source§impl<'de> Deserialize<'de> for NeighborsConfigwhere
NeighborsConfig: Default,
impl<'de> Deserialize<'de> for NeighborsConfigwhere
NeighborsConfig: Default,
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for NeighborsConfig
impl RefUnwindSafe for NeighborsConfig
impl Send for NeighborsConfig
impl Sync for NeighborsConfig
impl Unpin for NeighborsConfig
impl UnwindSafe for NeighborsConfig
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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