pub struct SubscribeOpts { /* private fields */ }Expand description
Options for subscribing to events.
Implementations§
Source§impl SubscribeOpts
impl SubscribeOpts
Sourcepub fn poll_interval(self, interval: Duration) -> Self
pub fn poll_interval(self, interval: Duration) -> Self
Set the base poll interval.
Pre-fix, Duration::ZERO was accepted verbatim,
and combined with a zero max_backoff the doubling loop
at current_interval = (current_interval * 2).min(max_backoff)
resolved to zero forever. The poll-then-zero-sleep-then-
wake_by_ref path then ran at 100 % CPU on an idle stream.
Clamp to a minimum of 1 ns so even pathological inputs stay
out of the spin path; production callers wanting a tight
poll should set Duration::from_millis(1) or similar.
Sourcepub fn max_backoff(self, max: Duration) -> Self
pub fn max_backoff(self, max: Duration) -> Self
Set the maximum backoff interval.
See poll_interval — the same zero-collapse hazard
applies. Clamped to a minimum of 1 ns so the doubling loop
always parks the task on a real timer rather than spinning.
Trait Implementations§
Source§impl Clone for SubscribeOpts
impl Clone for SubscribeOpts
Source§fn clone(&self) -> SubscribeOpts
fn clone(&self) -> SubscribeOpts
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SubscribeOpts
impl Debug for SubscribeOpts
Auto Trait Implementations§
impl Freeze for SubscribeOpts
impl RefUnwindSafe for SubscribeOpts
impl Send for SubscribeOpts
impl Sync for SubscribeOpts
impl Unpin for SubscribeOpts
impl UnsafeUnpin for SubscribeOpts
impl UnwindSafe for SubscribeOpts
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