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§
Source§impl<'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> Freeze for Toggle<'a, T>
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§
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more