Struct surge_param::ControlGroupArray
source · [−]pub struct ControlGroupArray<T> { /* private fields */ }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
sourceimpl<T> ControlGroupArray<T>
impl<T> ControlGroupArray<T>
sourcepub fn new(initial_value: T) -> Self where
T: Clone,
pub fn new(initial_value: T) -> Self where
T: Clone,
Create a new array filled with the given value.
sourcepub fn new_with<F>(initial_value: F) -> Self where
F: Fn(ControlGroup) -> T,
pub fn new_with<F>(initial_value: F) -> Self where
F: Fn(ControlGroup) -> T,
Create a new array using a closure to associate each enum variant with its initial value.
pub const fn len(&self) -> usize
pub const fn is_empty(&self) -> bool
pub fn iter<'a>(&'a self) -> impl Iterator<Item = &T>
pub fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &mut T>
sourcepub fn iter_enumerate<'a>(&'a self) -> impl Iterator<Item = (ControlGroup, &T)>
pub fn iter_enumerate<'a>(&'a self) -> impl Iterator<Item = (ControlGroup, &T)>
Iterate and Enumerate, where Enumerate yields enum variants instead of usize.
sourcepub fn iter_mut_enumerate<'a>(
&'a mut self
) -> impl Iterator<Item = (ControlGroup, &mut T)>
pub fn iter_mut_enumerate<'a>(
&'a mut self
) -> impl Iterator<Item = (ControlGroup, &mut T)>
Iterate and Enumerate, where Enumerate yields enum variants instead of usize.
sourcepub fn map<F, Q>(&self, f: F) -> ControlGroupArray<Q> where
F: Fn(&T) -> Q,
pub fn map<F, Q>(&self, f: F) -> ControlGroupArray<Q> where
F: Fn(&T) -> Q,
Returns an array like self, with function f applied to each element.
Trait Implementations
sourceimpl<T> Clone for ControlGroupArray<T> where
T: Clone,
impl<T> Clone for ControlGroupArray<T> where
T: Clone,
sourceimpl<T> Debug for ControlGroupArray<T> where
T: Debug,
impl<T> Debug for ControlGroupArray<T> where
T: Debug,
sourceimpl<T> Default for ControlGroupArray<T> where
T: Default,
impl<T> Default for ControlGroupArray<T> where
T: Default,
sourceimpl<T> Hash for ControlGroupArray<T> where
T: Hash,
impl<T> Hash for ControlGroupArray<T> where
T: Hash,
sourceimpl<T> Index<ControlGroup> for ControlGroupArray<T>
impl<T> Index<ControlGroup> for ControlGroupArray<T>
sourceimpl<T> IndexMut<ControlGroup> for ControlGroupArray<T>
impl<T> IndexMut<ControlGroup> for ControlGroupArray<T>
sourcefn index_mut(&mut self, x: ControlGroup) -> &mut Self::Output
fn index_mut(&mut self, x: ControlGroup) -> &mut Self::Output
Performs the mutable indexing (container[index]) operation. Read more
sourceimpl<'a, T> IntoIterator for &'a ControlGroupArray<T>
impl<'a, T> IntoIterator for &'a ControlGroupArray<T>
sourceimpl<'a, T> IntoIterator for &'a mut ControlGroupArray<T>
impl<'a, T> IntoIterator for &'a mut ControlGroupArray<T>
sourceimpl<T> Ord for ControlGroupArray<T> where
T: Ord,
impl<T> Ord for ControlGroupArray<T> where
T: Ord,
sourceimpl<T> PartialEq<ControlGroupArray<T>> for ControlGroupArray<T> where
T: PartialEq,
impl<T> PartialEq<ControlGroupArray<T>> for ControlGroupArray<T> where
T: PartialEq,
sourceimpl<T> PartialOrd<ControlGroupArray<T>> for ControlGroupArray<T> where
T: PartialOrd,
impl<T> PartialOrd<ControlGroupArray<T>> for ControlGroupArray<T> where
T: PartialOrd,
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<T> Copy for ControlGroupArray<T> where
T: Copy,
impl<T> Eq for ControlGroupArray<T> where
T: Eq,
Auto Trait Implementations
impl<T> RefUnwindSafe for ControlGroupArray<T> where
T: RefUnwindSafe,
impl<T> Send for ControlGroupArray<T> where
T: Send,
impl<T> Sync for ControlGroupArray<T> where
T: Sync,
impl<T> Unpin for ControlGroupArray<T> where
T: Unpin,
impl<T> UnwindSafe for ControlGroupArray<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more