pub struct Cycle<'a, T: Select> { /* private fields */ }
Expand description
Specifies a list of effects to cycle through. Each request causes the cycle to advance.
Example
use lifxi::http::prelude::*;
fn client() -> Client {
// TODO: Add lazy-static dependency and use it to make a shared client.
unimplemented!()
}
// Let's make a light show we can advance by pressing a button!
// Each press of our internet-connected button calls this function.
fn next() {
let red = State::builder().color(Color::Red);
let green = State::builder().color(Color::Green);
let white = State::builder().color(Color::White);
let shared = State::builder().color(Color::Brightness(1.0)).power(true);
let result = client()
.select(Selector::All)
.cycle()
.add(red)
.add(green)
.add(white)
.rev() // Let's mix it up a little!
.default(shared)
.send();
}
Implementations
Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for Cycle<'a, T>
impl<'a, T> Send for Cycle<'a, T>where
T: Sync,
impl<'a, T> Sync for Cycle<'a, T>where
T: Sync,
impl<'a, T> Unpin for Cycle<'a, T>
impl<'a, T> !UnwindSafe for Cycle<'a, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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