pub struct AdaptivePolling { /* private fields */ }Expand description
Adaptive polling manager
Implementations§
Source§impl AdaptivePolling
impl AdaptivePolling
Sourcepub fn new(config: AdaptivePollingConfig) -> Result<Self, AdaptivePollingError>
pub fn new(config: AdaptivePollingConfig) -> Result<Self, AdaptivePollingError>
Create a new adaptive polling manager
Sourcepub fn record_activity(&self)
pub fn record_activity(&self)
Record network activity (call this when events occur)
Sourcepub fn adjust_interval(&self)
pub fn adjust_interval(&self)
Adjust poll interval based on current activity
Sourcepub fn current_interval(&self) -> Duration
pub fn current_interval(&self) -> Duration
Get the current poll interval
Sourcepub fn activity_level(&self) -> ActivityLevel
pub fn activity_level(&self) -> ActivityLevel
Get the current activity level
Sourcepub fn time_since_activity(&self) -> Duration
pub fn time_since_activity(&self) -> Duration
Get the time since last activity
Sourcepub fn stats(&self) -> AdaptivePollingStats
pub fn stats(&self) -> AdaptivePollingStats
Get polling statistics
Auto Trait Implementations§
impl Freeze for AdaptivePolling
impl !RefUnwindSafe for AdaptivePolling
impl Send for AdaptivePolling
impl Sync for AdaptivePolling
impl Unpin for AdaptivePolling
impl !UnwindSafe for AdaptivePolling
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> 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