pub struct RoundRobinState { /* private fields */ }Expand description
Round-robin state for zone selection (stored in SamplerNode, not in SamplerInstrument).
Implementations§
Source§impl RoundRobinState
impl RoundRobinState
pub fn with_seed(seed: u64) -> Self
Sourcepub fn xorshift64(&mut self) -> u64
pub fn xorshift64(&mut self) -> u64
Xorshift64 pseudo-random number generator.
Sourcepub fn select(
&mut self,
group_idx: usize,
group_len: usize,
mode: &RoundRobinMode,
) -> usize
pub fn select( &mut self, group_idx: usize, group_len: usize, mode: &RoundRobinMode, ) -> usize
Select a zone index from a group according to the mode. Returns the index (0..group_len) of the selected zone.
Sourcepub fn select_zone<'a>(
&mut self,
group_idx: usize,
zones: &'a [SampleZone],
mode: &RoundRobinMode,
) -> Option<&'a SampleZone>
pub fn select_zone<'a>( &mut self, group_idx: usize, zones: &'a [SampleZone], mode: &RoundRobinMode, ) -> Option<&'a SampleZone>
Select a zone from a group according to the mode.
Trait Implementations§
Source§impl Clone for RoundRobinState
impl Clone for RoundRobinState
Source§fn clone(&self) -> RoundRobinState
fn clone(&self) -> RoundRobinState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RoundRobinState
impl Debug for RoundRobinState
Auto Trait Implementations§
impl Freeze for RoundRobinState
impl RefUnwindSafe for RoundRobinState
impl Send for RoundRobinState
impl Sync for RoundRobinState
impl Unpin for RoundRobinState
impl UnsafeUnpin for RoundRobinState
impl UnwindSafe for RoundRobinState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more