Struct spin_sleep::LoopHelperBuilder [−][src]
pub struct LoopHelperBuilder { /* fields omitted */ }
Builds LoopHelper
.
Implementations
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]
self,
target_rate: R
) -> LoopHelper
Builds a LoopHelper
targeting an input target_rate
.
Note: The target_rate
only affects
LoopHelper::loop_sleep
.
Trait Implementations
impl Clone for LoopHelperBuilder
[src]
fn clone(&self) -> LoopHelperBuilder
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for LoopHelperBuilder
[src]
impl Debug for LoopHelperBuilder
[src]
impl Eq for LoopHelperBuilder
[src]
impl PartialEq<LoopHelperBuilder> for LoopHelperBuilder
[src]
fn eq(&self, other: &LoopHelperBuilder) -> bool
[src]
fn ne(&self, other: &LoopHelperBuilder) -> bool
[src]
impl StructuralEq for LoopHelperBuilder
[src]
impl StructuralPartialEq for LoopHelperBuilder
[src]
Auto Trait Implementations
impl RefUnwindSafe for LoopHelperBuilder
impl Send for LoopHelperBuilder
impl Sync for LoopHelperBuilder
impl Unpin for LoopHelperBuilder
impl UnwindSafe for LoopHelperBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,