[][src]Struct governor::clock::QuantaUpkeepClock

pub struct QuantaUpkeepClock(_, _);

A clock using the default quanta::Clock structure and an upkeep thread.

This clock relies on an upkeep thread that wakes up in regular (user defined) intervals to retrieve the current time and update an atomic U64; the clock then can retrieve that time (and is as behind as, at most, that interval).

The background thread is stopped as soon as the last clone of the clock is dropped.

Whether this is faster than a QuantaClock depends on the utilization of the rate limiter and the upkeep interval that you pick; you should measure and compare performance before picking one or the other.

Implementations

impl QuantaUpkeepClock[src]

pub fn from_interval(interval: Duration) -> Result<QuantaUpkeepClock, Error>[src]

Returns a new QuantaUpkeepClock with an upkeep thread that wakes up once in interval.

pub fn from_builder(builder: Builder) -> Result<QuantaUpkeepClock, Error>[src]

Returns a new QuantaUpkeepClock with an upkeep thread as specified by the given builder.

Trait Implementations

impl Clock for QuantaUpkeepClock[src]

type Instant = QuantaInstant

A measurement of a monotonically increasing clock.

impl Clone for QuantaUpkeepClock[src]

impl Debug for QuantaUpkeepClock[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,