Skip to main content

WriteValue

Trait WriteValue 

Source
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§

Source

type Value: 'static

The type of the value’s value.

Required Methods§

Source

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§

Source

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", so this trait is not object safe.

Implementors§

Source§

impl<T> WriteValue for ArcStoredValue<T>
where T: 'static,

Source§

type Value = T

Source§

impl<T, S> WriteValue for StoredValue<T, S>
where T: 'static, S: Storage<ArcStoredValue<T>>,

Source§

type Value = T