pub trait ProbeCacheStore: Send + Sync {
// Required methods
fn load(&self) -> ProbeCacheSnapshot;
fn save(&self, snapshot: &ProbeCacheSnapshot) -> Result<(), ProbeCacheError>;
}Expand description
Where an Enumerator’s probe cache lives between runs.
A port, like HidBackend: the enumerator
knows what is worth keeping and when it changed, and nothing about where it
goes. openlogi-hid supplies the file-backed one native builds use.
Required Methods§
Sourcefn load(&self) -> ProbeCacheSnapshot
fn load(&self) -> ProbeCacheSnapshot
The last snapshot saved here, or an empty one.
Never fails: an absent, torn or foreign-schema store is a cold start, which the enumerator handles by re-probing — not an error worth propagating into device discovery.
Sourcefn save(&self, snapshot: &ProbeCacheSnapshot) -> Result<(), ProbeCacheError>
fn save(&self, snapshot: &ProbeCacheSnapshot) -> Result<(), ProbeCacheError>
Persist snapshot.
An Err is logged by the caller and the snapshot retried on the next
tick that dirties the cache, so a store may fail freely.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".