Trait concurrency_traits::rw_lock::RwLockSized[][src]

pub trait RwLockSized<'a>: Sized + RwLock<'a> + TryRwLockSized<'a> {
    fn read_func<O>(&'a self, func: impl FnOnce(&Self::Item) -> O) -> O { ... }
fn write_func<O>(&'a self, func: impl FnOnce(&mut Self::Item) -> O) -> O { ... } }
Expand description

The functions for RwLock that only work for sized types. Separated to allow RwLock to be a trait object.

Provided methods

fn read_func<O>(&'a self, func: impl FnOnce(&Self::Item) -> O) -> O[src]

Blocks until reading from the lock and then runs func on the result

Implementation

Should be overwritten by implementors if can be more optimal than creating a guard

fn write_func<O>(&'a self, func: impl FnOnce(&mut Self::Item) -> O) -> O[src]

Blocks until writing to the lock and then runs func on the result

Implementation

Should be overwritten by implementors if can be more optimal than creating a guard

Implementations on Foreign Types

impl<'a, T> RwLockSized<'a> for RwLock<T> where
    T: 'a, 
[src]

Implementors

impl<'a, T, R> RwLockSized<'a> for CustomRwLock<T, R> where
    T: 'a,
    R: RawRwLock + 'a, 
[src]

fn read_func<O>(&'a self, func: impl FnOnce(&Self::Item) -> O) -> O[src]

fn write_func<O>(&'a self, func: impl FnOnce(&mut Self::Item) -> O) -> O[src]