pub struct Activate<'a> { /* private fields */ }
Expand description
A configurable request for activating a specified scene.
Example
use lifxi::http::prelude::*;
let client = Client::new("foo");
let result = client
.scenes()
.activate("asdf")
.ignore("brightness")
.ignore("saturation")
.transition(::std::time::Duration::new(7, 0))
.overwrite(State::builder().power(true))
.send();
Implementations
sourceimpl<'a> Activate<'a>
impl<'a> Activate<'a>
sourcepub fn transition<D: Into<Duration>>(&mut self, transition: D) -> &mut Self
pub fn transition<D: Into<Duration>>(&mut self, transition: D) -> &mut Self
Sets the transition time for the scene activation.
Example
use lifxi::http::prelude::*;
let client = Client::new("foo");
let result = client
.scenes()
.activate("asdf")
.transition(::std::time::Duration::new(7, 0))
.send();
sourcepub fn ignore(&mut self, s: impl ToString) -> &mut Self
pub fn ignore(&mut self, s: impl ToString) -> &mut Self
Adds a property to the list of ignored properties when changing.
This method takes a string for now; in later versions, it will be strongly-typed.
Example
use lifxi::http::prelude::*;
let client = Client::new("foo");
let result = client
.scenes()
.activate("asdf")
.ignore("brightness")
.ignore("saturation")
.send();
sourcepub fn overwrite(&mut self, state: State) -> &mut Self
pub fn overwrite(&mut self, state: State) -> &mut Self
Sets an overriding state that will take priority over all scene attributes.
Example
use lifxi::http::prelude::*;
let client = Client::new("foo");
let result = client
.scenes()
.activate("asdf")
.overwrite(State::builder().power(true))
.send();
sourcepub fn fast(&mut self, fast: bool) -> &mut Self
pub fn fast(&mut self, fast: bool) -> &mut Self
Sets whether to perform the action quickly (skipping checks and verification).
Example
use lifxi::http::prelude::*;
let client = Client::new("foo");
let result = client
.scenes()
.activate("asdf")
.overwrite(State::builder().power(true))
.fast(true)
.send();
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Activate<'a>
impl<'a> Send for Activate<'a>
impl<'a> Sync for Activate<'a>
impl<'a> Unpin for Activate<'a>
impl<'a> !UnwindSafe for Activate<'a>
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