pub struct State {
pub timestamp: i64,
pub limits: Option<Power<Limit>>,
pub failsafes: Option<Power<i64>>,
pub trust: Option<Vec<TrustEntry>>,
pub notify: Option<Notify>,
pub measurements: Option<Vec<Meter>>,
pub supported_eebus_use_cases: Option<Vec<String>>,
}Expand description
Local device snapshot, selective reply or unsolicited update. limits and failsafes
use the same power.active nesting as Control.
use cls_eedi::wire::{Message, Payload};
let json = r#"{"type":"de.keo-connectivity.clseedi.state","id":"state-1",
"source":"meter-room","specversion":"1.0","data":{"protocol":"1.2.0",
"timestamp":1800000000,"failsafes":{"power":{"active":{"production":1500}}}}}"#;
let Payload::State(state) = Message::decode(json.as_bytes())?.payload else {
unreachable!()
};
assert_eq!(state.failsafes.and_then(|f| f.production), Some(1500));Fields§
§timestamp: i64§limits: Option<Power<Limit>>§failsafes: Option<Power<i64>>§trust: Option<Vec<TrustEntry>>§notify: Option<Notify>§measurements: Option<Vec<Meter>>§supported_eebus_use_cases: Option<Vec<String>>Trait Implementations§
Source§impl<'de> Deserialize<'de> for State
impl<'de> Deserialize<'de> for State
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 Eq for State
impl StructuralPartialEq for State
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnsafeUnpin for State
impl UnwindSafe for State
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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