Struct swc_common::sync::RwLock
source · [−]pub struct RwLock<T>(_);
Implementations
sourceimpl<T> RwLock<T>
impl<T> RwLock<T>
pub fn new(inner: T) -> Self
pub fn read(&self) -> ReadGuard<'_, T>
pub fn borrow(&self) -> ReadGuard<'_, T>
pub fn get_mut(&mut self) -> &mut 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_mut(&self) -> WriteGuard<'_, 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>where
T: Send + Sync,
impl<T> Unpin for RwLock<T>where
T: Unpin,
impl<T> UnwindSafe for RwLock<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more