pub struct DataChangeFilter {
    pub trigger: DataChangeTrigger,
    pub deadband_type: u32,
    pub deadband_value: f64,
}

Fields

trigger: DataChangeTriggerdeadband_type: u32deadband_value: f64

Implementations

Compares one data value to another and returns true if they differ, according to their trigger type of status, status/value or status/value/timestamp

Compares two variant values to each other. Returns true if they are considered the “same”.

Compares two values, either a straight value compare or a numeric comparison against the deadband settings. If deadband is asked for and the values are not convertible into a numeric value, the result is false. The value is true if the values are the same within the limits set.

The eu_range is the engineering unit range and represents the range that the value should typically operate between. It’s used for percentage change operations and ignored otherwise.

Errors

BadDeadbandFilterInvalid indicates the deadband settings were invalid, e.g. an invalid type, or the args were invalid. A (low, high) range must be supplied for a percentage deadband compare.

Compares the difference between v1 and v2 to the threshold. The two values are considered equal if their difference is less than or equal to the threshold.

Compares the percentage difference between v1 and v2 using the low-high range as the comparison. The two values are considered equal if their perentage difference is less than or equal to the threshold.

Trait Implementations

Returns the exact byte length of the structure as it would be if encode were called. This may be called prior to writing to ensure the correct amount of space is available. Read more

Encodes the instance to the write stream.

Decodes an instance from the read stream. The decoding options contains restrictions set by the server / client on the length of strings, arrays etc. If these limits are exceeded the implementation should return with a BadDecodingError as soon as possible. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.