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

The type of the value’s value.

Required Methods§

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>

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§

§

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

§

type Value = T

§

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

§

type Value = T