pub struct RwLock<T: ?Sized> { /* private fields */ }
Implementations§
source§impl<T> RwLock<T>
impl<T> RwLock<T>
pub const fn new(user_data: T) -> RwLock<T>
pub fn into_inner(self) -> T
source§impl<T: ?Sized> RwLock<T>
impl<T: ?Sized> RwLock<T>
pub fn read(&self) -> RwLockReadGuard<'_, T>
pub fn try_read(&self) -> Option<RwLockReadGuard<'_, T>>
sourcepub unsafe fn force_read_decrement(&self)
pub unsafe fn force_read_decrement(&self)
Safety
This is only safe if the lock is currently locked in read mode and the number of readers is not 0.
sourcepub unsafe fn force_write_unlock(&self)
pub unsafe fn force_write_unlock(&self)
Safety
The lock must be locked in write mode.
pub fn write(&self) -> RwLockWriteGuard<'_, T>
pub fn try_write(&self) -> Option<RwLockWriteGuard<'_, T>>
pub fn upgradeable_read(&self) -> RwLockUpgradeableGuard<'_, T>
pub fn try_upgradeable_read(&self) -> Option<RwLockUpgradeableGuard<'_, T>>
sourcepub unsafe fn get(&self) -> &T
pub unsafe fn get(&self) -> &T
Safety
Write locks may not be used in combination with this method.