pub struct Pulse<'a, T: Select> { /* private fields */ }
Expand description
Specifies a “pulse” effect, wherein the light color abruptly changes.
Implementations
sourceimpl<'a, T: Select> Pulse<'a, T>
impl<'a, T: Select> Pulse<'a, T>
sourcepub fn from(&mut self, color: Color) -> &mut Self
pub fn from(&mut self, color: Color) -> &mut Self
Sets the starting color.
If left blank, the current color of the bulb is used.
Example
use lifxi::http::prelude::*;
let secret = "foo";
let client = Client::new(secret);
let result = client
.select(Selector::All)
.pulse(Color::Green)
.from(Color::Red)
.send();
sourcepub fn period<D: Into<Duration>>(&mut self, period: D) -> &mut Self
pub fn period<D: Into<Duration>>(&mut self, period: D) -> &mut Self
Sets the animation duration.
Example
use lifxi::http::prelude::*;
let secret = "foo";
let client = Client::new(secret);
let result = client
.select(Selector::All)
.pulse(Color::Green)
.period(::std::time::Duration::new(7, 0))
.send();
sourcepub fn cycles(&mut self, count: u16) -> &mut Self
pub fn cycles(&mut self, count: u16) -> &mut Self
Sets the number of cycles to execute.
Example
use lifxi::http::prelude::*;
let secret = "foo";
let client = Client::new(secret);
let result = client
.select(Selector::All)
.pulse(Color::Green)
.cycles(11)
.send();
sourcepub fn persist(&mut self, keep: bool) -> &mut Self
pub fn persist(&mut self, keep: bool) -> &mut Self
Sets whether to keep the bulb at the stopping color after completion.
Example
use lifxi::http::prelude::*;
let secret = "foo";
let client = Client::new(secret);
let result = client
.select(Selector::All)
.pulse(Color::Green)
.persist(true)
.send();
Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for Pulse<'a, T>
impl<'a, T> Send for Pulse<'a, T>where
T: Sync,
impl<'a, T> Sync for Pulse<'a, T>where
T: Sync,
impl<'a, T> Unpin for Pulse<'a, T>
impl<'a, T> !UnwindSafe for Pulse<'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