[][src]Struct huemanity::lightstructs::SendableState

pub struct SendableState {
    pub on: Option<bool>,
    pub bri: Option<u8>,
    pub hue: Option<u32>,
    pub sat: Option<u8>,
    pub effect: Option<String>,
    pub xy: Option<[f32; 2]>,
    pub alert: Option<String>,
}

Helper object with some tweaks to serialisation. In order to use this object you have to do one of the following:

let state_1: SendableState = serde_json::from_str(r#"{"on":true}"#);
let state_2: SendableState = SendableState {on:true, ..SendableState::default()};
let state_3: SendableState = state!(on: true, xy: [1.0, 0.123])

Fields

on: Option<bool>bri: Option<u8>hue: Option<u32>sat: Option<u8>effect: Option<String>xy: Option<[f32; 2]>alert: Option<String>

Trait Implementations

impl Debug for SendableState[src]

impl Default for SendableState[src]

fn default() -> Self[src]

Initialises the state as Nones

impl<'de> Deserialize<'de> for SendableState[src]

impl Serialize for SendableState[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err