Struct yeelight::FlowExpresion
source · pub struct FlowExpresion(pub Vec<FlowTuple>);
Expand description
FlowExpresion consisting of a series of FlowTuple
s
Example
let duration = Duration::from_secs(1);
let brightness = 100; // percentage 1..100 (-1 to keep previous)
let police = FlowExpresion(vec![
FlowTuple::rgb(duration, 0xff_00_00, brightness),
FlowTuple::rgb(duration, 0x00_00_ff, brightness),
]);
let police2 = FlowExpresion(vec![
FlowTuple::rgb(duration, 0xff_00_00, brightness),
FlowTuple::rgb(duration, 0xff_00_00, 1),
FlowTuple::rgb(duration, 0xff_00_00, brightness),
FlowTuple::sleep(duration),
FlowTuple::rgb(duration, 0x00_00_ff, brightness),
FlowTuple::rgb(duration, 0x00_00_ff, 1),
FlowTuple::rgb(duration, 0x00_00_ff, brightness),
FlowTuple::sleep(duration),
]);
Tuple Fields§
§0: Vec<FlowTuple>
Trait Implementations§
source§impl Clone for FlowExpresion
impl Clone for FlowExpresion
source§fn clone(&self) -> FlowExpresion
fn clone(&self) -> FlowExpresion
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for FlowExpresion
impl Debug for FlowExpresion
source§impl<'de> Deserialize<'de> for FlowExpresion
impl<'de> Deserialize<'de> for FlowExpresion
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl FromStr for FlowExpresion
impl FromStr for FlowExpresion
Auto Trait Implementations§
impl RefUnwindSafe for FlowExpresion
impl Send for FlowExpresion
impl Sync for FlowExpresion
impl Unpin for FlowExpresion
impl UnwindSafe for FlowExpresion
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