Struct surge_wavetable::imports::imports::imports::ControlTypeArray [−]
pub struct ControlTypeArray<T> { /* fields omitted */ }
Expand description
Container to associate each enum variant with a datum.
This is an array type and it implements much of the array API, with a few caveats and exceptions. The foremost deviation from the standard array API is that this container must be indexed using variants of the correct enum type.
Implementations
impl<T> ControlTypeArray<T>
impl<T> ControlTypeArray<T>
pub fn new(initial_value: T) -> ControlTypeArray<T> where
T: Clone,
pub fn new(initial_value: T) -> ControlTypeArray<T> where
T: Clone,
Create a new array filled with the given value.
pub fn new_with<F>(initial_value: F) -> ControlTypeArray<T> where
F: Fn(ControlType) -> T,
pub fn new_with<F>(initial_value: F) -> ControlTypeArray<T> where
F: Fn(ControlType) -> T,
Create a new array using a closure to associate each enum variant with its initial value.
pub fn iter_enumerate(&'a self) -> impl Iterator<Item = (ControlType, &'a T)>
pub fn iter_enumerate(&'a self) -> impl Iterator<Item = (ControlType, &'a T)>
Iterate and Enumerate, where Enumerate yields enum variants instead of usize.
pub fn iter_mut_enumerate(
&'a mut self
) -> impl Iterator<Item = (ControlType, &'a mut T)>
pub fn iter_mut_enumerate(
&'a mut self
) -> impl Iterator<Item = (ControlType, &'a mut T)>
Iterate and Enumerate, where Enumerate yields enum variants instead of usize.
pub fn map<F, Q>(&self, f: F) -> ControlTypeArray<Q> where
F: Fn(&T) -> Q,
pub fn map<F, Q>(&self, f: F) -> ControlTypeArray<Q> where
F: Fn(&T) -> Q,
Returns an array like self, with function f applied to each element.
Trait Implementations
impl<T> Clone for ControlTypeArray<T> where
T: Clone,
impl<T> Clone for ControlTypeArray<T> where
T: Clone,
pub fn clone(&self) -> ControlTypeArray<T>
pub fn clone(&self) -> ControlTypeArray<T>
Returns a copy of the value. Read more
Performs copy-assignment from source
. Read more
impl<T> Debug for ControlTypeArray<T> where
T: Debug,
impl<T> Debug for ControlTypeArray<T> where
T: Debug,
impl<T> Default for ControlTypeArray<T> where
T: Default,
impl<T> Default for ControlTypeArray<T> where
T: Default,
pub fn default() -> ControlTypeArray<T>
pub fn default() -> ControlTypeArray<T>
Returns the “default value” for a type. Read more
impl<T> Hash for ControlTypeArray<T> where
T: Hash,
impl<T> Hash for ControlTypeArray<T> where
T: Hash,
impl<T> Index<ControlType> for ControlTypeArray<T>
impl<T> Index<ControlType> for ControlTypeArray<T>
type Output = T
type Output = T
The returned type after indexing.
pub fn index(
&self,
x: ControlType
) -> &<ControlTypeArray<T> as Index<ControlType>>::Output
pub fn index(
&self,
x: ControlType
) -> &<ControlTypeArray<T> as Index<ControlType>>::Output
Performs the indexing (container[index]
) operation. Read more
impl<T> IndexMut<ControlType> for ControlTypeArray<T>
impl<T> IndexMut<ControlType> for ControlTypeArray<T>
pub fn index_mut(
&mut self,
x: ControlType
) -> &mut <ControlTypeArray<T> as Index<ControlType>>::Output
pub fn index_mut(
&mut self,
x: ControlType
) -> &mut <ControlTypeArray<T> as Index<ControlType>>::Output
Performs the mutable indexing (container[index]
) operation. Read more
impl<'a, T> IntoIterator for &'a mut ControlTypeArray<T>
impl<'a, T> IntoIterator for &'a mut ControlTypeArray<T>
impl<'a, T> IntoIterator for &'a ControlTypeArray<T>
impl<'a, T> IntoIterator for &'a ControlTypeArray<T>
impl<T> Ord for ControlTypeArray<T> where
T: Ord,
impl<T> Ord for ControlTypeArray<T> where
T: Ord,
pub fn cmp(&self, other: &ControlTypeArray<T>) -> Ordering
pub fn cmp(&self, other: &ControlTypeArray<T>) -> Ordering
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
impl<T> PartialEq<ControlTypeArray<T>> for ControlTypeArray<T> where
T: PartialEq<T>,
impl<T> PartialEq<ControlTypeArray<T>> for ControlTypeArray<T> where
T: PartialEq<T>,
impl<T> PartialOrd<ControlTypeArray<T>> for ControlTypeArray<T> where
T: PartialOrd<T>,
impl<T> PartialOrd<ControlTypeArray<T>> for ControlTypeArray<T> where
T: PartialOrd<T>,
pub fn partial_cmp(&self, other: &ControlTypeArray<T>) -> Option<Ordering>
pub fn partial_cmp(&self, other: &ControlTypeArray<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
impl<T> Copy for ControlTypeArray<T> where
T: Copy,
impl<T> Eq for ControlTypeArray<T> where
T: Eq,
Auto Trait Implementations
impl<T> RefUnwindSafe for ControlTypeArray<T> where
T: RefUnwindSafe,
impl<T> Send for ControlTypeArray<T> where
T: Send,
impl<T> Sync for ControlTypeArray<T> where
T: Sync,
impl<T> Unpin for ControlTypeArray<T> where
T: Unpin,
impl<T> UnwindSafe for ControlTypeArray<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more