pub trait Dictionary {
type Key: 'static;
type Value: 'static;
type Guard: WatcherGuard;
// Required methods
fn get(&self, key: &Self::Key) -> Option<Self::Value>;
fn watch(
&self,
key: &Self::Key,
watcher: impl Fn(Context<Option<Self::Value>>) + 'static,
) -> Self::Guard;
}Expand description
A trait for dictionary-like data structures that support reactive watching of key-value pairs.
Required Associated Types§
Sourcetype Guard: WatcherGuard
type Guard: WatcherGuard
The type of guard returned when registering a watcher.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.