pub struct Toggle<'a, T: Select> { /* private fields */ }
Expand description
A scoped request to toggle specific lights which may be further customized.
Examples
Transition
use lifxi::http::prelude::*;
let client = Client::new("foo");
let result = client
.select(Selector::All)
.toggle()
.transition(::std::time::Duration::new(2, 0))
.send();
Immediate
use lifxi::http::prelude::*;
let client = Client::new("foo");
let result = client
.select(Selector::All)
.toggle()
.send();
Implementations
sourceimpl<'a, T: Select> Toggle<'a, T>
impl<'a, T: Select> Toggle<'a, T>
sourcepub fn transition<D: Into<Duration>>(&self, duration: D) -> Request<'_, Duration>
pub fn transition<D: Into<Duration>>(&self, duration: D) -> Request<'_, Duration>
Sets the transition time for the toggle.
Example
use lifxi::http::prelude::*;
let client = Client::new("foo");
let result = client
.select(Selector::All)
.toggle()
.transition(::std::time::Duration::new(2, 0))
.send();
Trait Implementations
Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for Toggle<'a, T>
impl<'a, T> Send for Toggle<'a, T>where
T: Sync,
impl<'a, T> Sync for Toggle<'a, T>where
T: Sync,
impl<'a, T> Unpin for Toggle<'a, T>
impl<'a, T> !UnwindSafe for Toggle<'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