Trait WriteValue
pub trait WriteValue: Sized + DefinedAt {
type Value: 'static;
// Required method
fn try_write_value(&self) -> Option<UntrackedWriteGuard<Self::Value>>;
// Provided method
fn write_value(&self) -> UntrackedWriteGuard<Self::Value> { ... }
}Expand description
A variation of the Write trait that provides a signposted “always-non-reactive” API.
E.g. for StoredValue.
Required Associated Types§
type Value: 'static
type Value: 'static
The type of the value’s value.
Required Methods§
fn try_write_value(&self) -> Option<UntrackedWriteGuard<Self::Value>>
fn try_write_value(&self) -> Option<UntrackedWriteGuard<Self::Value>>
Returns a non-reactive write guard, or None if the value has already been disposed.
Provided Methods§
fn write_value(&self) -> UntrackedWriteGuard<Self::Value>
fn write_value(&self) -> UntrackedWriteGuard<Self::Value>
Returns a non-reactive write guard.
§Panics
Panics if you try to access a value that has been disposed.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".