pub struct PollBudget { /* private fields */ }Expand description
The short window a caller blocks for, counted in polls.
Injected rather than read from a constant where the waiting happens. A caller that cannot choose the window has to spend the production one to observe either answer, so the test that proves a command is handed to the background costs ten seconds - and a suite that cannot afford that instead proves nothing about the shape it ships.
Implementations§
Source§impl PollBudget
impl PollBudget
Sourcepub const DEFAULT: PollBudget
pub const DEFAULT: PollBudget
What a person gets: 500 polls of 20 ms, which is ten seconds.
Sourcepub fn new(polls: u32, interval_ms: u64) -> PollBudget
pub fn new(polls: u32, interval_ms: u64) -> PollBudget
A window of this many polls, waiting this long between them.
Trait Implementations§
Source§impl Clone for PollBudget
impl Clone for PollBudget
impl Copy for PollBudget
Source§impl Debug for PollBudget
impl Debug for PollBudget
Source§impl Default for PollBudget
impl Default for PollBudget
Source§fn default() -> PollBudget
fn default() -> PollBudget
Returns the “default value” for a type. Read more
impl Eq for PollBudget
Source§impl PartialEq for PollBudget
impl PartialEq for PollBudget
impl StructuralPartialEq for PollBudget
Auto Trait Implementations§
impl Freeze for PollBudget
impl RefUnwindSafe for PollBudget
impl Send for PollBudget
impl Sync for PollBudget
impl Unpin for PollBudget
impl UnsafeUnpin for PollBudget
impl UnwindSafe for PollBudget
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