Struct concurrency_traits::rw_lock::CustomRwLock [−][src]
pub struct CustomRwLock<T, R> { /* fields omitted */ }
Expand description
A custom rw lock that can be built from any RawTryRwLock
variant
Implementations
impl<T, R> CustomRwLock<T, R>
[src]
impl<T, R> CustomRwLock<T, R>
[src]pub fn from_raw(raw_lock: R, data: T) -> Self
[src]
pub fn from_raw(raw_lock: R, data: T) -> Self
[src]Creates a lock from a RawTryRwLock
variant
pub fn new(data: T) -> Self where
R: Default,
[src]
pub fn new(data: T) -> Self where
R: Default,
[src]Creates a lock using thr RawTryRwLock
variant’s default
implementation
Trait Implementations
impl<'a, T, R> AsyncRwLock<'a> for CustomRwLock<T, R> where
T: 'a + Send + Sync,
R: RawAsyncRwLock + 'a + Send + Sync,
[src]
impl<'a, T, R> AsyncRwLock<'a> for CustomRwLock<T, R> where
T: 'a + Send + Sync,
R: RawAsyncRwLock + 'a + Send + Sync,
[src]fn read_async<'async_trait>(
&'a self
) -> Pin<Box<dyn Future<Output = Self::ReadGuard> + Send + 'async_trait>> where
'a: 'async_trait,
Self: 'async_trait,
[src]
fn read_async<'async_trait>(
&'a self
) -> Pin<Box<dyn Future<Output = Self::ReadGuard> + Send + 'async_trait>> where
'a: 'async_trait,
Self: 'async_trait,
[src]Reads the lock asynchronously, giving a future that will contain the read lock Read more
fn write_async<'async_trait>(
&'a self
) -> Pin<Box<dyn Future<Output = Self::WriteGuard> + Send + 'async_trait>> where
'a: 'async_trait,
Self: 'async_trait,
[src]
fn write_async<'async_trait>(
&'a self
) -> Pin<Box<dyn Future<Output = Self::WriteGuard> + Send + 'async_trait>> where
'a: 'async_trait,
Self: 'async_trait,
[src]Writes to the lock asynchronously, giving a future that will contain the write lock Read more
impl<'a, T, R> AsyncTimeoutRwLock<'a> for CustomRwLock<T, R> where
T: 'a + Send + Sync,
R: RawAsyncTimeoutRwLock + 'a + Send + Sync,
[src]
impl<'a, T, R> AsyncTimeoutRwLock<'a> for CustomRwLock<T, R> where
T: 'a + Send + Sync,
R: RawAsyncTimeoutRwLock + 'a + Send + Sync,
[src]fn read_timeout_async<'async_trait>(
&'a self,
timeout: Duration
) -> Pin<Box<dyn Future<Output = Option<Self::ReadGuard>> + Send + 'async_trait>> where
'a: 'async_trait,
Self: 'async_trait,
[src]
fn read_timeout_async<'async_trait>(
&'a self,
timeout: Duration
) -> Pin<Box<dyn Future<Output = Option<Self::ReadGuard>> + Send + 'async_trait>> where
'a: 'async_trait,
Self: 'async_trait,
[src]Reads from the lock with a timeout asynchronously
fn write_timeout_async<'async_trait>(
&'a self,
timeout: Duration
) -> Pin<Box<dyn Future<Output = Option<Self::WriteGuard>> + Send + 'async_trait>> where
'a: 'async_trait,
Self: 'async_trait,
[src]
fn write_timeout_async<'async_trait>(
&'a self,
timeout: Duration
) -> Pin<Box<dyn Future<Output = Option<Self::WriteGuard>> + Send + 'async_trait>> where
'a: 'async_trait,
Self: 'async_trait,
[src]Writes to the lock with a timeout asynchronously
impl<T: Debug, R: Debug> Debug for CustomRwLock<T, R>
[src]
impl<T: Debug, R: Debug> Debug for CustomRwLock<T, R>
[src]impl<'a, T, R> RwLock<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawRwLock + 'a,
[src]
impl<'a, T, R> RwLock<'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]
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 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 Read more
fn write_func<O>(&'a self, func: impl FnOnce(&mut Self::Item) -> O) -> O
[src]
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 Read more
impl<'a, T, R> TimeoutRwLock<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawTimeoutRwLock + 'a,
[src]
impl<'a, T, R> TimeoutRwLock<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawTimeoutRwLock + 'a,
[src]fn read_timeout(&'a self, timeout: Duration) -> Option<Self::ReadGuard>
[src]
fn read_timeout(&'a self, timeout: Duration) -> Option<Self::ReadGuard>
[src]Reads from the lock with a timeout
fn write_timeout(&'a self, timeout: Duration) -> Option<Self::WriteGuard>
[src]
fn write_timeout(&'a self, timeout: Duration) -> Option<Self::WriteGuard>
[src]Writes to the lock with a timeout
impl<'a, T, R> TimeoutRwLockSized<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawTimeoutRwLock + 'a,
[src]
impl<'a, T, R> TimeoutRwLockSized<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawTimeoutRwLock + 'a,
[src]impl<'a, T, R> TryRwLock<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawTryRwLock + 'a,
[src]
impl<'a, T, R> TryRwLock<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawTryRwLock + 'a,
[src]type Item = T
type Item = T
The item stored by this lock
type ReadGuard = CustomReadGuard<'a, T, R>
type ReadGuard = CustomReadGuard<'a, T, R>
The guard for reading from this lock
type WriteGuard = CustomWriteGuard<'a, T, R>
type WriteGuard = CustomWriteGuard<'a, T, R>
The guard for writing to this lock
fn try_read(&'a self) -> Option<Self::ReadGuard>
[src]
fn try_read(&'a self) -> Option<Self::ReadGuard>
[src]Tries to read from the lock, returning None
if cannot immediately
fn try_write(&'a self) -> Option<Self::WriteGuard>
[src]
fn try_write(&'a self) -> Option<Self::WriteGuard>
[src]Tries to write to the lock, returning None
if not able to immediately
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]impl<'a, T, R> AsyncTimeoutUpgradeRwLock<'a> for CustomRwLock<T, R> where
T: 'a + Send + Sync,
R: RawAsyncTimeoutUpgradeRwLock + 'a + Send + Sync,
[src]
T: 'a + Send + Sync,
R: RawAsyncTimeoutUpgradeRwLock + 'a + Send + Sync,
impl<'a, T, R> AsyncUpgradeRwLock<'a> for CustomRwLock<T, R> where
T: 'a + Send + Sync,
R: RawAsyncUpgradeRwLock + 'a + Send + Sync,
[src]
T: 'a + Send + Sync,
R: RawAsyncUpgradeRwLock + 'a + Send + Sync,
impl<'a, T, R> DowngradeRwLock<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawDowngradeRwLock + 'a,
[src]
T: 'a,
R: RawDowngradeRwLock + 'a,
impl<T, R> Sync for CustomRwLock<T, R> where
T: Sync,
R: Sync,
[src]
T: Sync,
R: Sync,
impl<'a, T, R> TryUpgradeRwLock<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawTryUpgradeRwLock + 'a,
[src]
T: 'a,
R: RawTryUpgradeRwLock + 'a,
impl<'a, T, R> UpgradeRwLock<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawUpgradeRwLock + 'a,
[src]
T: 'a,
R: RawUpgradeRwLock + 'a,
impl<'a, T, R> UpgradeTimeoutRwLock<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawUpgradeTimeoutRwLock + 'a,
[src]
T: 'a,
R: RawUpgradeTimeoutRwLock + 'a,
Auto Trait Implementations
impl<T, R> !RefUnwindSafe for CustomRwLock<T, R>
impl<T, R> Send for CustomRwLock<T, R> where
R: Send,
T: Send,
R: Send,
T: Send,
impl<T, R> Unpin for CustomRwLock<T, R> where
R: Unpin,
T: Unpin,
R: Unpin,
T: Unpin,
impl<T, R> UnwindSafe for CustomRwLock<T, R> where
R: UnwindSafe,
T: UnwindSafe,
R: UnwindSafe,
T: UnwindSafe,