pub trait DataVersionSource: Debug {
// Required methods
fn version(&self, endpoint: EndpointId, cluster: ClusterId) -> u32;
fn touch(&self, endpoint: EndpointId, cluster: ClusterId);
}Expand description
Where a Server gets a cluster’s data version.
A trait rather than a concrete table so that Server does not take the table’s capacity as a
generic parameter — the capacity is the integrator’s business and nothing in the server’s
signature should depend on it.
Required Methods§
Sourcefn version(&self, endpoint: EndpointId, cluster: ClusterId) -> u32
fn version(&self, endpoint: EndpointId, cluster: ClusterId) -> u32
The current version of one cluster instance, allocating one if it has never been read.
Sourcefn touch(&self, endpoint: EndpointId, cluster: ClusterId)
fn touch(&self, endpoint: EndpointId, cluster: ClusterId)
Records that an attribute of this cluster instance changed.
“A cluster data version SHALL be incremented if any attribute data changes” — any, so a cluster that changes on its own (a sensor reading, a switch someone pressed) has to call this too. Only writes that arrive through the interaction model are automatic.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".