Struct spin_sleep::LoopHelperBuilder
source · pub struct LoopHelperBuilder { /* private fields */ }
Expand description
Builds LoopHelper
.
Implementations§
source§impl LoopHelperBuilder
impl LoopHelperBuilder
sourcepub fn report_interval_s(self, seconds: Seconds) -> Self
pub fn report_interval_s(self, seconds: Seconds) -> Self
Sets the interval between
LoopHelper::report_rate
reports in seconds.
sourcepub fn report_interval(self, duration: Duration) -> Self
pub fn report_interval(self, duration: Duration) -> Self
Sets the interval between
LoopHelper::report_rate
reports.
sourcepub fn native_accuracy_ns(self, accuracy: SubsecondNanoseconds) -> Self
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.
sourcepub fn build_without_target_rate(self) -> LoopHelper
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.
sourcepub fn build_with_target_rate<R: Into<RatePerSecond>>(
self,
target_rate: R
) -> LoopHelper
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§
source§impl Clone for LoopHelperBuilder
impl Clone for LoopHelperBuilder
source§fn clone(&self) -> LoopHelperBuilder
fn clone(&self) -> LoopHelperBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LoopHelperBuilder
impl Debug for LoopHelperBuilder
source§impl PartialEq<LoopHelperBuilder> for LoopHelperBuilder
impl PartialEq<LoopHelperBuilder> for LoopHelperBuilder
source§fn eq(&self, other: &LoopHelperBuilder) -> bool
fn eq(&self, other: &LoopHelperBuilder) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for LoopHelperBuilder
impl Eq for LoopHelperBuilder
impl StructuralEq for LoopHelperBuilder
impl StructuralPartialEq for LoopHelperBuilder
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§
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