[][src]Struct spin_sleep::LoopHelperBuilder

pub struct LoopHelperBuilder { /* fields omitted */ }

Builds LoopHelper.

Methods

impl LoopHelperBuilder[src]

pub fn report_interval_s(self, seconds: Seconds) -> Self[src]

Sets the interval between LoopHelper::report_rate reports in seconds.

pub fn report_interval(self, duration: Duration) -> Self[src]

Sets the interval between LoopHelper::report_rate reports.

pub fn native_accuracy_ns(self, accuracy: SubsecondNanoseconds) -> Self[src]

Sets the native sleep accuracy. See SpinSleeper::new for details.

Defaults to a platform specific opinionated value, that can change from release to release. Set this to ensure consistent behaviour across releases. However, consider that this value should be tuned & tested for a given platform.

pub fn build_without_target_rate(self) -> LoopHelper[src]

Builds a LoopHelper without targeting a rate. This means all calls to LoopHelper::loop_sleep will simply return immediately. Normally used when only interested in the LoopHelper rate reporting.

pub fn build_with_target_rate<R: Into<RatePerSecond>>(
    self,
    target_rate: R
) -> LoopHelper
[src]

Builds a LoopHelper targeting an input target_rate. Note: The target_rate only affects LoopHelper::loop_sleep.

Trait Implementations

impl Clone for LoopHelperBuilder[src]

impl Copy for LoopHelperBuilder[src]

impl Debug for LoopHelperBuilder[src]

impl Eq for LoopHelperBuilder[src]

impl PartialEq<LoopHelperBuilder> for LoopHelperBuilder[src]

impl StructuralEq for LoopHelperBuilder[src]

impl StructuralPartialEq for LoopHelperBuilder[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.