pub trait SetValue: DefinedAt {
type Value;
// Required method
fn try_set_value(&self, value: Self::Value) -> Option<Self::Value>;
// Provided method
fn set_value(&self, value: Self::Value) { ... }
}Expand description
A variation of the Set trait that provides a signposted “always-non-reactive” API.
E.g. for StoredValue.
Required Associated Types§
Required Methods§
Sourcefn try_set_value(&self, value: Self::Value) -> Option<Self::Value>
fn try_set_value(&self, value: Self::Value) -> Option<Self::Value>
Updates the value by replacing it, non-reactively.
If the value has already been disposed, returns Some(value) with the value that was
passed in. Otherwise, returns None.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".