Struct surge_param::ValTypeArray
source · [−]pub struct ValTypeArray<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> ValTypeArray<T>
impl<T> ValTypeArray<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(ValType) -> T,
pub fn new_with<F>(initial_value: F) -> Self where
F: Fn(ValType) -> 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 = (ValType, &T)>
pub fn iter_enumerate<'a>(&'a self) -> impl Iterator<Item = (ValType, &T)>
Iterate and Enumerate, where Enumerate yields enum variants instead of usize.
sourcepub fn iter_mut_enumerate<'a>(
&'a mut self
) -> impl Iterator<Item = (ValType, &mut T)>
pub fn iter_mut_enumerate<'a>(
&'a mut self
) -> impl Iterator<Item = (ValType, &mut T)>
Iterate and Enumerate, where Enumerate yields enum variants instead of usize.
sourcepub fn map<F, Q>(&self, f: F) -> ValTypeArray<Q> where
F: Fn(&T) -> Q,
pub fn map<F, Q>(&self, f: F) -> ValTypeArray<Q> where
F: Fn(&T) -> Q,
Returns an array like self, with function f applied to each element.
Trait Implementations
sourceimpl<T> Clone for ValTypeArray<T> where
T: Clone,
impl<T> Clone for ValTypeArray<T> where
T: Clone,
sourceimpl<T> Debug for ValTypeArray<T> where
T: Debug,
impl<T> Debug for ValTypeArray<T> where
T: Debug,
sourceimpl<T> Default for ValTypeArray<T> where
T: Default,
impl<T> Default for ValTypeArray<T> where
T: Default,
sourceimpl<T> Hash for ValTypeArray<T> where
T: Hash,
impl<T> Hash for ValTypeArray<T> where
T: Hash,
sourceimpl<T> Index<ValType> for ValTypeArray<T>
impl<T> Index<ValType> for ValTypeArray<T>
sourceimpl<T> IndexMut<ValType> for ValTypeArray<T>
impl<T> IndexMut<ValType> for ValTypeArray<T>
sourceimpl<'a, T> IntoIterator for &'a ValTypeArray<T>
impl<'a, T> IntoIterator for &'a ValTypeArray<T>
sourceimpl<'a, T> IntoIterator for &'a mut ValTypeArray<T>
impl<'a, T> IntoIterator for &'a mut ValTypeArray<T>
sourceimpl<T> Ord for ValTypeArray<T> where
T: Ord,
impl<T> Ord for ValTypeArray<T> where
T: Ord,
sourceimpl<T> PartialEq<ValTypeArray<T>> for ValTypeArray<T> where
T: PartialEq,
impl<T> PartialEq<ValTypeArray<T>> for ValTypeArray<T> where
T: PartialEq,
sourceimpl<T> PartialOrd<ValTypeArray<T>> for ValTypeArray<T> where
T: PartialOrd,
impl<T> PartialOrd<ValTypeArray<T>> for ValTypeArray<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 ValTypeArray<T> where
T: Copy,
impl<T> Eq for ValTypeArray<T> where
T: Eq,
Auto Trait Implementations
impl<T> RefUnwindSafe for ValTypeArray<T> where
T: RefUnwindSafe,
impl<T> Send for ValTypeArray<T> where
T: Send,
impl<T> Sync for ValTypeArray<T> where
T: Sync,
impl<T> Unpin for ValTypeArray<T> where
T: Unpin,
impl<T> UnwindSafe for ValTypeArray<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