Trait With
pub trait With: DefinedAt {
type Value: ?Sized;
// Required method
fn try_with<U>(&self, fun: impl FnOnce(&Self::Value) -> U) -> Option<U>;
// Provided method
fn with<U>(&self, fun: impl FnOnce(&Self::Value) -> U) -> U { ... }
}
Expand description
Give read-only access to a signal’s value by reference inside a closure, and subscribes the active reactive observer (an effect or computed) to changes in its value.
Required Associated Types§
Required Methods§
Provided 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.