pub trait Signal: Clone + 'static {
type Output: 'static;
type Guard: WatcherGuard;
// Required methods
fn get(&self) -> Self::Output;
fn watch(
&self,
watcher: impl Fn(Context<Self::Output>) + 'static,
) -> Self::Guard;
}Expand description
The core trait for reactive system.
Types implementing Signal represent a computation that can produce a value
and notify observers when that value changes.
Required Associated Types§
Sourcetype Guard: WatcherGuard
type Guard: WatcherGuard
The guard type returned by the watch method that manages watcher lifecycle.
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.