Struct choreographer::engine::Sequence [−][src]
pub struct Sequence<R, const N: usize> { /* fields omitted */ }
Expand description
A sequence of Action
s with maximum length N.
The total Sequence
also has a LoopBehavior
that describes the looping behavior of the entire
sequence (e.g. play the sequence N times, once,
forever).
LoopBehavior
: LoopBehavior)
Sequence
: Sequence
Implementations
Create an array of new, empty sequences.
This is often useful when creating an array for multiple
LEDs. Alternatively, call Default::default()
for the same effect.
Example
Creating an array of Sequence
s and setting each one to a script:
let mut leds: [Sequence<MicroTimer, 8>; 16] = Sequence::new_array(); for led in leds.iter_mut() { led.set(&script!( | action | color | duration_ms | period_ms_f | phase_offset_ms | repeat | | solid | BLACK | 1000 | 0.0 | 0 | once | | sin | WHITE | 2500 | 2500.0 | 0 | once | | solid | BLACK | 1000 | 0.0 | 0 | once | ), LoopBehavior::OneShot); }
Clear the current set of actions, and fill the sequence with the given new actions.
If actions
is larger than the capacity of self
, remaining items
will be ignored
Trait Implementations
Auto Trait Implementations
impl<R, const N: usize> RefUnwindSafe for Sequence<R, N> where
R: RefUnwindSafe,
impl<R, const N: usize> UnwindSafe for Sequence<R, N> where
R: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more