Trait concurrency_traits::rw_lock::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 { ... } }
Expand description
Provided methods
fn try_read_func<O>(&'a self, func: impl FnOnce(Option<&Self::Item>) -> O) -> O
[src]
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]
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
Implementations on Foreign Types
impl<'a, T> TryRwLockSized<'a> for RwLock<T> where
T: 'a,
[src]
T: 'a,
Implementors
impl<'a, T, R> TryRwLockSized<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawTryRwLock + 'a,
[src]
impl<'a, T, R> TryRwLockSized<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawTryRwLock + 'a,
[src]fn try_read_func<O>(&'a self, func: impl FnOnce(Option<&Self::Item>) -> O) -> O
[src]
fn try_write_func<O>(
&'a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O
[src]
&'a self,
func: impl FnOnce(Option<&mut Self::Item>) -> O
) -> O