pub trait Property:
Clone
+ Send
+ Sync
+ PartialEq
+ 'static {
const KEY: &'static str;
}Expand description
The property trait, re-exported so downstream crates can write code that is generic over properties.
Without this a consumer needing P::KEY — a UI caching watch handles by
(speaker, property), say — has to depend on sonos-sdk-state directly and
reach past this facade into a crate documented as an implementation detail.
That also puts the trait’s breaking changes outside this crate’s version
contract, since sonos-sdk-state is not covered by its semver gate.
Marker trait for properties that can be stored and watched
Properties must be:
- Clone: For copying values to watchers
- Send + Sync: For thread-safe access
- PartialEq: For change detection (only emit when value actually changes)
- ’static: For type-erased storage using TypeId
The KEY constant provides a human-readable identifier for debugging, logging, and event filtering.
Required Associated Constants§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".