pub struct PeerSelectorConfig {
pub distance_weight: f64,
pub quality_weight: f64,
pub latency_weight: f64,
pub bandwidth_weight: f64,
pub enable_caching: bool,
pub cache_ttl_secs: u64,
pub max_cache_entries: usize,
}Expand description
Configuration for peer selector
Fields§
§distance_weight: f64Weight for geographic distance (0.0 - 1.0)
quality_weight: f64Weight for connection quality (0.0 - 1.0)
latency_weight: f64Weight for latency (0.0 - 1.0)
bandwidth_weight: f64Weight for bandwidth (0.0 - 1.0)
enable_caching: boolEnable selection caching
cache_ttl_secs: u64Cache TTL in seconds
max_cache_entries: usizeMaximum cache size
Implementations§
Source§impl PeerSelectorConfig
impl PeerSelectorConfig
Sourcepub fn low_latency() -> Self
pub fn low_latency() -> Self
Configuration optimized for low latency
Sourcepub fn high_bandwidth() -> Self
pub fn high_bandwidth() -> Self
Configuration optimized for high bandwidth
Trait Implementations§
Source§impl Clone for PeerSelectorConfig
impl Clone for PeerSelectorConfig
Source§fn clone(&self) -> PeerSelectorConfig
fn clone(&self) -> PeerSelectorConfig
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 PeerSelectorConfig
impl Debug for PeerSelectorConfig
Auto Trait Implementations§
impl Freeze for PeerSelectorConfig
impl RefUnwindSafe for PeerSelectorConfig
impl Send for PeerSelectorConfig
impl Sync for PeerSelectorConfig
impl Unpin for PeerSelectorConfig
impl UnwindSafe for PeerSelectorConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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