Trait concurrency_traits::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 { ... } }
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]
impl<'a, T> RwLockSized<'a> for RwLock<T> where
T: 'a,
[src]impl<'__a, 'a, T> RwLockSized<'__a> for &'a T where
T: RwLockSized<'__a>,
[src]
impl<'__a, 'a, T> RwLockSized<'__a> for &'a T where
T: RwLockSized<'__a>,
[src]impl<'__a, 'a, T> RwLockSized<'__a> for &'a mut T where
T: RwLockSized<'__a>,
[src]
impl<'__a, 'a, T> RwLockSized<'__a> for &'a mut T where
T: RwLockSized<'__a>,
[src]impl<'__a, T> RwLockSized<'__a> for ManuallyDrop<T> where
T: RwLockSized<'__a>,
[src]
impl<'__a, T> RwLockSized<'__a> for ManuallyDrop<T> where
T: RwLockSized<'__a>,
[src]impl<'__a, T> RwLockSized<'__a> for AssertUnwindSafe<T> where
T: RwLockSized<'__a>,
[src]
impl<'__a, T> RwLockSized<'__a> for AssertUnwindSafe<T> where
T: RwLockSized<'__a>,
[src]impl<'__a, T> RwLockSized<'__a> for Rc<T> where
T: RwLockSized<'__a>,
[src]
impl<'__a, T> RwLockSized<'__a> for Rc<T> where
T: RwLockSized<'__a>,
[src]impl<'__a, T> RwLockSized<'__a> for Arc<T> where
T: RwLockSized<'__a>,
[src]
impl<'__a, T> RwLockSized<'__a> for Arc<T> where
T: RwLockSized<'__a>,
[src]impl<'__a, T> RwLockSized<'__a> for Box<T> where
T: RwLockSized<'__a>,
[src]
impl<'__a, T> RwLockSized<'__a> for Box<T> where
T: RwLockSized<'__a>,
[src]impl<'__a, 'a, T> RwLockSized<'__a> for Cow<'a, T> where
T: RwLockSized<'__a> + Clone,
[src]
impl<'__a, 'a, T> RwLockSized<'__a> for Cow<'a, T> where
T: RwLockSized<'__a> + Clone,
[src]impl<'a, T> RwLockSized<'a> for Pin<T> where
T: Deref,
T::Target: RwLockSized<'a>,
[src]
impl<'a, T> RwLockSized<'a> for Pin<T> where
T: Deref,
T::Target: RwLockSized<'a>,
[src]Implementors
impl<'a, T, R> RwLockSized<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawRwLock + 'a,
[src]
impl<'a, T, R> RwLockSized<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawRwLock + 'a,
[src]