Struct rustc_data_structures::sync::RwLock
source · pub struct RwLock<T>(InnerRwLock<T>);
Tuple Fields§
§0: InnerRwLock<T>
Implementations§
source§impl<T> RwLock<T>
impl<T> RwLock<T>
pub fn new(inner: T) -> Self
pub fn into_inner(self) -> T
pub fn get_mut(&mut self) -> &mut T
pub fn read(&self) -> ReadGuard<'_, T>
pub fn with_read_lock<F: FnOnce(&T) -> R, R>(&self, f: F) -> R
pub fn try_write(&self) -> Result<WriteGuard<'_, T>, ()>
pub fn write(&self) -> WriteGuard<'_, T>
pub fn with_write_lock<F: FnOnce(&mut T) -> R, R>(&self, f: F) -> R
pub fn borrow(&self) -> ReadGuard<'_, T>
pub fn borrow_mut(&self) -> WriteGuard<'_, T>
pub fn clone_guard<'a>(rg: &ReadGuard<'a, T>) -> ReadGuard<'a, T>
pub fn leak(&self) -> &T
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for RwLock<T>
impl<T> Send for RwLock<T>where
T: Send,
impl<T> !Sync for RwLock<T>
impl<T> Unpin for RwLock<T>where
T: Unpin,
impl<T> UnwindSafe for RwLock<T>where
T: UnwindSafe,
Blanket Implementations§
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> Erased for T
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.