pub enum SwitchBufferState<I> {
Constant(bool),
Varying(TimedSwitchValues<I>),
}
Expand description
Represents the state of an switched value across a buffer
Variants§
Constant(bool)
The value is constant across the buffer.
Varying(TimedSwitchValues<I>)
The value changes over the course of the buffer, represented by a
TimedSwitchValues
.
Implementations§
Source§impl<I: IntoIterator<Item = TimedValue<bool>>> SwitchBufferState<I>
impl<I: IntoIterator<Item = TimedValue<bool>>> SwitchBufferState<I>
Sourcepub fn value_at_start_of_buffer(self) -> bool
pub fn value_at_start_of_buffer(self) -> bool
Get the value of the parameter at the start of the buffer.
§Examples
assert_eq!(SwitchBufferState::Varying(TimedSwitchValues::new(
vec![TimedValue { sample_offset: 0, value: true },
TimedValue { sample_offset: 100, value: false }],
128,
).unwrap()).value_at_start_of_buffer(), true);
Trait Implementations§
Source§impl<I: Clone> Clone for SwitchBufferState<I>
impl<I: Clone> Clone for SwitchBufferState<I>
Source§fn clone(&self) -> SwitchBufferState<I>
fn clone(&self) -> SwitchBufferState<I>
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 moreAuto Trait Implementations§
impl<I> Freeze for SwitchBufferState<I>where
I: Freeze,
impl<I> RefUnwindSafe for SwitchBufferState<I>where
I: RefUnwindSafe,
impl<I> Send for SwitchBufferState<I>where
I: Send,
impl<I> Sync for SwitchBufferState<I>where
I: Sync,
impl<I> Unpin for SwitchBufferState<I>where
I: Unpin,
impl<I> UnwindSafe for SwitchBufferState<I>where
I: UnwindSafe,
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