Struct failsafe::WindowedAdder
source · pub struct WindowedAdder { /* private fields */ }
Expand description
Time windowed counter.
Implementations§
source§impl WindowedAdder
impl WindowedAdder
sourcepub fn new(window: Duration, slices: u8) -> Self
pub fn new(window: Duration, slices: u8) -> Self
Creates a new counter.
window
- The range of time to be kept in the counter.slices
- The number of slices that are maintained; a higher number of slices means finer granularity but also more memory consumption. Must be more than 1 and less then 10.
§Panics
- When
slices
isn’t in range [1;10].
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WindowedAdder
impl RefUnwindSafe for WindowedAdder
impl Send for WindowedAdder
impl Sync for WindowedAdder
impl Unpin for WindowedAdder
impl UnwindSafe for WindowedAdder
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