pub struct SamplingRate { /* private fields */ }Expand description
A simple sampler.
use infinity_sampler::SamplingRate;
let mut sampler = SamplingRate::new(2);
assert_eq!(sampler.step(), false);
assert_eq!(sampler.step(), true);
assert_eq!(sampler.step(), false);
assert_eq!(sampler.step(), true);
sampler.div(2);
assert_eq!(sampler.step(), false);
assert_eq!(sampler.step(), false);
assert_eq!(sampler.step(), false);
assert_eq!(sampler.step(), true);
assert_eq!(sampler.step(), false);
assert_eq!(sampler.step(), false);
assert_eq!(sampler.step(), false);
assert_eq!(sampler.step(), true);Implementations§
Trait Implementations§
Source§impl Clone for SamplingRate
impl Clone for SamplingRate
Source§fn clone(&self) -> SamplingRate
fn clone(&self) -> SamplingRate
Returns a duplicate 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 moreimpl Copy for SamplingRate
Auto Trait Implementations§
impl Freeze for SamplingRate
impl RefUnwindSafe for SamplingRate
impl Send for SamplingRate
impl Sync for SamplingRate
impl Unpin for SamplingRate
impl UnwindSafe for SamplingRate
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