cushy::reactive::value

Trait DynamicRead

Source
pub trait DynamicRead<T> {
    // Required methods
    fn read(&self) -> DynamicGuard<'_, T, true>;
    fn read_nonblocking(
        &self,
    ) -> Result<DynamicGuard<'_, T, true>, TryLockError<'_>>;
}
Expand description

Read access to a value stored in a Dynamic.

Required Methods§

Source

fn read(&self) -> DynamicGuard<'_, T, true>

Returns a guard that provides exclusive, read-only access to the value contained wihtin this dynamic.

Source

fn read_nonblocking( &self, ) -> Result<DynamicGuard<'_, T, true>, TryLockError<'_>>

Attempts to obtain a guard that provides exclusive, read-only access to the value contained wihtin this dynamic.

§Errors

Returns an error if blocking would be required to lock this dynamic.

Implementors§