Struct choreographer::engine::Sequence[][src]

pub struct Sequence<R, const N: usize> { /* fields omitted */ }
Expand description

A sequence of Actions 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 a new, empty sequence

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 Sequences 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);

}

Create a new, empty sequence

Clear the current set of actions, leaving the Sequence empty

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

Poll the currently active Action, potentially also moving to the next Action if necessary.

When any Action is active, an RGB8 will be returned

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.