Struct spin_sleep::LoopHelperBuilder [−][src]
pub struct LoopHelperBuilder { /* fields omitted */ }
Builds LoopHelper
.
Methods
impl LoopHelperBuilder
[src]
impl LoopHelperBuilder
pub fn report_interval_s(self, seconds: Seconds) -> Self
[src]
pub fn report_interval_s(self, seconds: Seconds) -> Self
Sets the interval between
LoopHelper::report_rate
reports in seconds.
pub fn report_interval(self, duration: Duration) -> Self
[src]
pub fn report_interval(self, duration: Duration) -> Self
Sets the interval between
LoopHelper::report_rate
reports.
pub fn native_accuracy_ns(self, accuracy: SubsecondNanoseconds) -> Self
[src]
pub fn native_accuracy_ns(self, accuracy: SubsecondNanoseconds) -> Self
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]
pub fn build_without_target_rate(self) -> LoopHelper
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]
pub fn build_with_target_rate<R: Into<RatePerSecond>>(
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 Debug for LoopHelperBuilder
[src]
impl Debug for LoopHelperBuilder
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for LoopHelperBuilder
[src]
impl Clone for LoopHelperBuilder
fn clone(&self) -> LoopHelperBuilder
[src]
fn clone(&self) -> LoopHelperBuilder
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for LoopHelperBuilder
[src]
impl Copy for LoopHelperBuilder
impl PartialEq for LoopHelperBuilder
[src]
impl PartialEq for LoopHelperBuilder
fn eq(&self, other: &LoopHelperBuilder) -> bool
[src]
fn eq(&self, other: &LoopHelperBuilder) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &LoopHelperBuilder) -> bool
[src]
fn ne(&self, other: &LoopHelperBuilder) -> bool
This method tests for !=
.
impl Eq for LoopHelperBuilder
[src]
impl Eq for LoopHelperBuilder
Auto Trait Implementations
impl Send for LoopHelperBuilder
impl Send for LoopHelperBuilder
impl Sync for LoopHelperBuilder
impl Sync for LoopHelperBuilder