Struct eva_common::events::RawStateEvent
source · pub struct RawStateEvent<'a> {
pub status: ItemStatus,
pub value: ValueOption<'a>,
pub force: Force,
pub t: Option<f64>,
pub status_compare: Option<ItemStatus>,
pub value_compare: ValueOption<'a>,
pub status_else: Option<ItemStatus>,
pub value_else: ValueOption<'a>,
pub on_modified: Option<OnModified<'a>>,
}Expand description
Submitted by services via the bus for local items
Fields§
§status: ItemStatus§value: ValueOption<'a>§force: Force§t: Option<f64>Override the time of the event
status_compare: Option<ItemStatus>Compare the status with the current status (optional)
value_compare: ValueOption<'a>Compare the value with the current value (optional)
status_else: Option<ItemStatus>if comparison is used and unequal, set item status. In case if status is not specified,
crate::ITEM_STATUS_ERROR is used
value_else: ValueOption<'a>if comparison is used and unequal, set item value (optional)
on_modified: Option<OnModified<'a>>If the item is modified, OnModified rules are applied
Implementations§
source§impl<'a> RawStateEvent<'a>
impl<'a> RawStateEvent<'a>
pub fn new(status: ItemStatus, value: &'a Value) -> Self
pub fn new0(status: ItemStatus) -> Self
pub fn force(self) -> Self
pub fn force_update(self) -> Self
pub fn at(self, t: f64) -> Self
Trait Implementations§
source§impl<'a> Clone for RawStateEvent<'a>
impl<'a> Clone for RawStateEvent<'a>
source§fn clone(&self) -> RawStateEvent<'a>
fn clone(&self) -> RawStateEvent<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<'a> Debug for RawStateEvent<'a>
impl<'a> Debug for RawStateEvent<'a>
source§impl<'a> Default for RawStateEvent<'a>
impl<'a> Default for RawStateEvent<'a>
source§fn default() -> RawStateEvent<'a>
fn default() -> RawStateEvent<'a>
Returns the “default value” for a type. Read more
source§impl<'a> From<RawStateBulkEvent<'a>> for RawStateEvent<'a>
impl<'a> From<RawStateBulkEvent<'a>> for RawStateEvent<'a>
source§fn from(r: RawStateBulkEvent<'a>) -> Self
fn from(r: RawStateBulkEvent<'a>) -> Self
Converts to this type from the input type.
source§impl<'a> PartialEq for RawStateEvent<'a>
impl<'a> PartialEq for RawStateEvent<'a>
source§impl<'a> Serialize for RawStateEvent<'a>
impl<'a> Serialize for RawStateEvent<'a>
impl<'a> Eq for RawStateEvent<'a>
impl<'a> StructuralPartialEq for RawStateEvent<'a>
Auto Trait Implementations§
impl<'a> Freeze for RawStateEvent<'a>
impl<'a> RefUnwindSafe for RawStateEvent<'a>
impl<'a> Send for RawStateEvent<'a>
impl<'a> Sync for RawStateEvent<'a>
impl<'a> Unpin for RawStateEvent<'a>
impl<'a> UnwindSafe for RawStateEvent<'a>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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