pub struct PresetState<const B: usize = MAX_BUTTONS, const E: usize = MAX_ENCODERS> {
pub button_active: [bool; B],
pub cycle_index: [u8; B],
pub encoder_values: [u8; E],
}Expand description
Runtime state for a single preset (not persisted across power cycles).
Fields§
§cycle_index: [u8; B]§encoder_values: [u8; E]Implementations§
Source§impl<const B: usize, const E: usize> PresetState<B, E>
impl<const B: usize, const E: usize> PresetState<B, E>
Sourcepub fn from_defaults<const A: usize>(preset: &Preset<B, E, A>) -> Self
pub fn from_defaults<const A: usize>(preset: &Preset<B, E, A>) -> Self
Create a PresetState from a preset’s declared defaults.
Trait Implementations§
Source§impl<const B: usize, const E: usize> Clone for PresetState<B, E>
impl<const B: usize, const E: usize> Clone for PresetState<B, E>
Source§fn clone(&self) -> PresetState<B, E>
fn clone(&self) -> PresetState<B, E>
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 moreimpl<const B: usize, const E: usize> Eq for PresetState<B, E>
Source§impl<const B: usize, const E: usize> PartialEq for PresetState<B, E>
impl<const B: usize, const E: usize> PartialEq for PresetState<B, E>
Source§fn eq(&self, other: &PresetState<B, E>) -> bool
fn eq(&self, other: &PresetState<B, E>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<const B: usize, const E: usize> StructuralPartialEq for PresetState<B, E>
Auto Trait Implementations§
impl<const B: usize, const E: usize> Freeze for PresetState<B, E>
impl<const B: usize, const E: usize> RefUnwindSafe for PresetState<B, E>
impl<const B: usize, const E: usize> Send for PresetState<B, E>
impl<const B: usize, const E: usize> Sync for PresetState<B, E>
impl<const B: usize, const E: usize> Unpin for PresetState<B, E>
impl<const B: usize, const E: usize> UnsafeUnpin for PresetState<B, E>
impl<const B: usize, const E: usize> UnwindSafe for PresetState<B, E>
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