pub struct AtomicInterval { /* private fields */ }Implementationsยง
Sourceยงimpl AtomicInterval
impl AtomicInterval
Sourcepub fn should_update(&self, interval_time_ms: u64) -> bool
pub fn should_update(&self, interval_time_ms: u64) -> bool
true if โinterval_time_msโ has elapsed since last time we returned true as long as it has been โinterval_time_msโ since this struct was created
Sourcepub fn should_update_ext(&self, interval_time_ms: u64, skip_first: bool) -> bool
pub fn should_update_ext(&self, interval_time_ms: u64, skip_first: bool) -> bool
a primary use case is periodic metric reporting, potentially from different threads true if โinterval_time_msโ has elapsed since last time we returned true except, if skip_first=false, false until โinterval_time_msโ has elapsed since this struct was created
Sourcepub fn elapsed_ms(&self) -> u64
pub fn elapsed_ms(&self) -> u64
return ms elapsed since the last time the time was set
Sourcepub fn remaining_until_next_interval(&self, interval_time: u64) -> u64
pub fn remaining_until_next_interval(&self, interval_time: u64) -> u64
return ms until the interval_time will have elapsed
Trait Implementationsยง
Sourceยงimpl Debug for AtomicInterval
impl Debug for AtomicInterval
Sourceยงimpl Default for AtomicInterval
impl Default for AtomicInterval
Sourceยงfn default() -> AtomicInterval
fn default() -> AtomicInterval
Returns the โdefault valueโ for a type. Read more
Auto Trait Implementationsยง
impl !Freeze for AtomicInterval
impl RefUnwindSafe for AtomicInterval
impl Send for AtomicInterval
impl Sync for AtomicInterval
impl Unpin for AtomicInterval
impl UnwindSafe for AtomicInterval
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
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 moreSourceยงimpl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Sourceยงfn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.Sourceยงimpl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Sourceยงfn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.Sourceยงimpl<T> Pointable for T
impl<T> Pointable for T
Sourceยงimpl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Sourceยงfn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Sourceยงimpl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Sourceยงfn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.