Trait concurrency_traits::TryRwLockSized[][src]

pub trait TryRwLockSized<'a>: Sized + TryRwLock<'a> {
    fn try_read_func<O>(
        &'a self,
        func: impl FnOnce(Option<&Self::Item>) -> O
    ) -> O { ... }
fn try_write_func<O>(
        &'a self,
        func: impl FnOnce(Option<&mut Self::Item>) -> O
    ) -> O { ... } }

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

Provided methods

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

Tries to read from the lock and runs func on the result

Implementation

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

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

Tries to write to the lock and runs func on the result

Implementation

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

Loading content...

Implementations on Foreign Types

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

impl<'__a, 'a, T> TryRwLockSized<'__a> for &'a T where
    T: TryRwLockSized<'__a>, 
[src]

impl<'__a, 'a, T> TryRwLockSized<'__a> for &'a mut T where
    T: TryRwLockSized<'__a>, 
[src]

impl<'__a, T> TryRwLockSized<'__a> for ManuallyDrop<T> where
    T: TryRwLockSized<'__a>, 
[src]

impl<'__a, T> TryRwLockSized<'__a> for AssertUnwindSafe<T> where
    T: TryRwLockSized<'__a>, 
[src]

impl<'__a, T> TryRwLockSized<'__a> for Rc<T> where
    T: TryRwLockSized<'__a>, 
[src]

impl<'__a, T> TryRwLockSized<'__a> for Arc<T> where
    T: TryRwLockSized<'__a>, 
[src]

impl<'__a, T> TryRwLockSized<'__a> for Box<T> where
    T: TryRwLockSized<'__a>, 
[src]

impl<'__a, 'a, T> TryRwLockSized<'__a> for Cow<'a, T> where
    T: TryRwLockSized<'__a> + Clone
[src]

impl<'a, T> TryRwLockSized<'a> for Pin<T> where
    T: Deref,
    T::Target: TryRwLockSized<'a>, 
[src]

Loading content...

Implementors

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

Loading content...