Struct concurrency_traits::CustomRwLock [−][src]
pub struct CustomRwLock<T, R> { /* fields omitted */ }
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]
Creates a lock from a RawTryRwLock
variant
pub fn new(data: T) -> Self where
R: Default,
[src]
R: Default,
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,
R: RawAsyncRwLock + 'a,
[src]
impl<'a, T, R> AsyncRwLock<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawAsyncRwLock + 'a,
[src]type AsyncReadGuard = CustomReadGuard<'a, T, R>
The read guard for async reading
type AsyncWriteGuard = CustomWriteGuard<'a, T, R>
The write guard for async writing
type ReadFuture = Pin<Box<dyn Future<Output = Self::AsyncReadGuard> + 'a>>
The future returned by read_async
type WriteFuture = Pin<Box<dyn Future<Output = Self::AsyncWriteGuard> + 'a>>
The future returned by write_async
fn read_async(&'a self) -> Self::ReadFuture
[src]
fn write_async(&'a self) -> Self::WriteFuture
[src]
impl<'a, T, R> AsyncRwLockSized<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawAsyncRwLock + 'a,
[src]
impl<'a, T, R> AsyncRwLockSized<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawAsyncRwLock + 'a,
[src]fn read_async_func<F>(
&'a self,
func: impl FnOnce(&Self::Item) -> F + 'a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + 'a>> where
F: Future,
[src]
&'a self,
func: impl FnOnce(&Self::Item) -> F + 'a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + 'a>> where
F: Future,
fn write_async_func<F>(
&'a self,
func: impl FnOnce(&mut Self::Item) -> F + 'a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + 'a>> where
F: Future,
[src]
&'a self,
func: impl FnOnce(&mut Self::Item) -> F + 'a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + 'a>> where
F: Future,
impl<'a, T, R> AsyncTimeoutRwLock<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawAsyncTimeoutRwLock + 'a,
[src]
impl<'a, T, R> AsyncTimeoutRwLock<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawAsyncTimeoutRwLock + 'a,
[src]type ReadTimeoutFuture = Pin<Box<dyn Future<Output = Option<Self::AsyncReadGuard>> + 'a>>
The future returned by AsyncTimeoutRwLock::read_timeout_async
type WriteTimeoutFuture = Pin<Box<dyn Future<Output = Option<Self::AsyncWriteGuard>> + 'a>>
The future returned by AsyncTimeoutRwLock::write_timeout_async
fn read_timeout_async(&'a self, timeout: Duration) -> Self::ReadTimeoutFuture
[src]
fn write_timeout_async(&'a self, timeout: Duration) -> Self::WriteTimeoutFuture
[src]
impl<'a, T, R> AsyncTimeoutRwLockSized<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawAsyncTimeoutRwLock + 'a,
[src]
impl<'a, T, R> AsyncTimeoutRwLockSized<'a> for CustomRwLock<T, R> where
T: 'a,
R: RawAsyncTimeoutRwLock + 'a,
[src]fn read_timeout_async_func<F>(
&'a self,
timeout: Duration,
func: impl FnOnce(Option<&Self::Item>) -> F + 'a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + 'a>> where
F: Future,
[src]
&'a self,
timeout: Duration,
func: impl FnOnce(Option<&Self::Item>) -> F + 'a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + 'a>> where
F: Future,
fn write_timeout_async_func<F>(
&'a self,
timeout: Duration,
func: impl FnOnce(Option<&mut Self::Item>) -> F + 'a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + 'a>> where
F: Future,
[src]
&'a self,
timeout: Duration,
func: impl FnOnce(Option<&mut Self::Item>) -> F + 'a
) -> Pin<Box<dyn Future<Output = <F as Future>::Output> + 'a>> where
F: Future,
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]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 write_timeout(&'a self, timeout: Duration) -> Option<Self::WriteGuard>
[src]
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
The item stored by this lock
type ReadGuard = CustomReadGuard<'a, T, R>
The guard for reading from this lock
type WriteGuard = CustomWriteGuard<'a, T, R>
The guard for writing to this lock
fn try_read(&'a self) -> Option<Self::ReadGuard>
[src]
fn try_write(&'a self) -> Option<Self::WriteGuard>
[src]
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
Auto Trait Implementations
impl<T, R> !RefUnwindSafe for CustomRwLock<T, R>
impl<T, R> !RefUnwindSafe for CustomRwLock<T, R>
impl<T, R> Send for CustomRwLock<T, R> where
R: Send,
T: Send,
impl<T, R> Send for CustomRwLock<T, R> where
R: Send,
T: Send,
impl<T, R> !Sync for CustomRwLock<T, R>
impl<T, R> !Sync for CustomRwLock<T, R>
impl<T, R> Unpin for CustomRwLock<T, R> where
R: Unpin,
T: Unpin,
impl<T, R> Unpin for CustomRwLock<T, R> where
R: Unpin,
T: Unpin,
impl<T, R> UnwindSafe for CustomRwLock<T, R> where
R: UnwindSafe,
T: UnwindSafe,
impl<T, R> UnwindSafe for CustomRwLock<T, R> where
R: UnwindSafe,
T: UnwindSafe,