pub struct AdaptivePollingConfig {
pub min_interval: Duration,
pub max_interval: Duration,
pub default_interval: Duration,
pub idle_increase_factor: f64,
pub active_decrease_factor: f64,
pub idle_threshold: Duration,
pub enable_sleep_mode: bool,
pub sleep_interval: Duration,
pub sleep_threshold: Duration,
}Expand description
Configuration for adaptive polling
Fields§
§min_interval: DurationMinimum poll interval (fastest polling rate)
max_interval: DurationMaximum poll interval (slowest polling rate)
default_interval: DurationDefault poll interval when activity is moderate
idle_increase_factor: f64Interval increase factor when idle (multiplier)
active_decrease_factor: f64Interval decrease factor when active (multiplier)
idle_threshold: DurationTime threshold to consider network idle
enable_sleep_mode: boolEnable sleep mode when completely inactive
sleep_interval: DurationSleep mode interval (very long poll interval)
sleep_threshold: DurationTime threshold to enter sleep mode
Implementations§
Source§impl AdaptivePollingConfig
impl AdaptivePollingConfig
Sourcepub fn high_performance() -> Self
pub fn high_performance() -> Self
Configuration for high-performance mode (minimal latency)
Sourcepub fn validate(&self) -> Result<(), AdaptivePollingError>
pub fn validate(&self) -> Result<(), AdaptivePollingError>
Validate the configuration
Trait Implementations§
Source§impl Clone for AdaptivePollingConfig
impl Clone for AdaptivePollingConfig
Source§fn clone(&self) -> AdaptivePollingConfig
fn clone(&self) -> AdaptivePollingConfig
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 AdaptivePollingConfig
impl Debug for AdaptivePollingConfig
Auto Trait Implementations§
impl Freeze for AdaptivePollingConfig
impl RefUnwindSafe for AdaptivePollingConfig
impl Send for AdaptivePollingConfig
impl Sync for AdaptivePollingConfig
impl Unpin for AdaptivePollingConfig
impl UnwindSafe for AdaptivePollingConfig
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