[−][src]Struct try_rwlock::TryRwLock
A readers-writer lock.
Implementations
impl<T> TryRwLock<T>
[src]
#[must_use]pub const fn new(data: T) -> Self
[src]
Create a new unlocked TryRwLock<T>
.
pub fn try_read(&self) -> Option<ReadGuard<'_, T>>
[src]
Attempt to lock this TryRwLock
with shared read access.
If the lock is currently being written to or there are usize::MAX
existing readers, this
function will return None
.
pub fn try_write(&self) -> Option<WriteGuard<'_, T>>
[src]
Attempt to lock this TryRwLock
with unique write access.
If the lock is currently being written to or read from, this function will return None
.
#[must_use]pub fn into_inner(self) -> T
[src]
Get the underlying data of the lock.
#[must_use]pub fn get_mut(&mut self) -> &mut T
[src]
Get a mutable reference to the underlying data.
As this method takes a mutable reference, no locking needs to take place.
Trait Implementations
impl<T: Debug> Debug for TryRwLock<T>
[src]
impl<T: Default> Default for TryRwLock<T>
[src]
impl<T> From<T> for TryRwLock<T>
[src]
impl<T: Send> Send for TryRwLock<T>
[src]
impl<T: Send + Sync> Sync for TryRwLock<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for TryRwLock<T>
impl<T> Unpin for TryRwLock<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for TryRwLock<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,