Struct blocks_iterator::PeriodCounter
source · pub struct PeriodCounter { /* private fields */ }
Expand description
Contains counter and instants to provide per period stats over transaction and blocks processed
Implementations§
source§impl PeriodCounter
impl PeriodCounter
sourcepub fn new(period: Duration) -> Self
pub fn new(period: Duration) -> Self
Create a PeriodCounter
with given period
sourcepub fn count_block(&mut self, block: &Block)
pub fn count_block(&mut self, block: &Block)
Count statistics of the given block
sourcepub fn period_elapsed(&mut self) -> Option<Stats>
pub fn period_elapsed(&mut self) -> Option<Stats>
If self.period
has passed since last invocation return stats
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for PeriodCounter
impl Send for PeriodCounter
impl Sync for PeriodCounter
impl Unpin for PeriodCounter
impl UnwindSafe for PeriodCounter
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