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§
Sourcefn read(&self) -> DynamicGuard<'_, T, true>
fn read(&self) -> DynamicGuard<'_, T, true>
Returns a guard that provides exclusive, read-only access to the value contained wihtin this dynamic.
Sourcefn read_nonblocking(
&self,
) -> Result<DynamicGuard<'_, T, true>, TryLockError<'_>>
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.