pub struct Scene {
pub uuid: String,
pub name: String,
pub account: Account,
pub states: Vec<State>,
pub created_at: i64,
pub updated_at: i64,
pub error: Option<String>,
pub errors: Option<Vec<Error>>,
}
Expand description
Represents an LIFX Scene
Fields§
§uuid: String
§name: String
§account: Account
§states: Vec<State>
§created_at: i64
§updated_at: i64
§error: Option<String>
§errors: Option<Vec<Error>>
Implementations§
Source§impl Scene
impl Scene
Sourcepub async fn async_list(config: LifxConfig) -> Result<Scenes, Error>
pub async fn async_list(config: LifxConfig) -> Result<Scenes, Error>
Asynchronously gets ALL scenes belonging to the authenticated account
§Arguments
access_token
- A personal acces token for authentication with LIFX.
§Examples
extern crate lifx_rs as lifx;
#[tokio::main]
async fn main() {
let key = "xxx".to_string();
let mut api_endpoints: Vec<String> = Vec::new();
api_endpoints.push(format!("https://api.lifx.com"));
api_endpoints.push(format!("http://localhost:8089"));
let config = lifx::LifxConfig{
access_token: key.clone(),
api_endpoints: api_endpoints
};
let scenes = lifx::Scene::async_list(config).await?;
}
Sourcepub fn list(config: LifxConfig) -> Result<Scenes, Error>
pub fn list(config: LifxConfig) -> Result<Scenes, Error>
Gets ALL scenes belonging to the authenticated account
§Arguments
access_token
- A personal acces token for authentication with LIFX.
§Examples
extern crate lifx_rs as lifx;
fn main() {
let key = "xxx".to_string();
let mut api_endpoints: Vec<String> = Vec::new();
api_endpoints.push(format!("https://api.lifx.com"));
api_endpoints.push(format!("http://localhost:8089"));
let config = lifx::LifxConfig{
access_token: key.clone(),
api_endpoints: api_endpoints
};
let scenes = lifx::Scene::list_all(config)?;
}
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Scene
impl<'de> Deserialize<'de> for Scene
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
impl StructuralPartialEq for Scene
Auto Trait Implementations§
impl Freeze for Scene
impl RefUnwindSafe for Scene
impl Send for Scene
impl Sync for Scene
impl Unpin for Scene
impl UnwindSafe for Scene
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