Struct rustc_data_structures::sync::Lock
source · [−]pub struct Lock<T>(InnerLock<T>);
Tuple Fields
0: InnerLock<T>
Implementations
sourceimpl<T> Lock<T>
impl<T> Lock<T>
pub fn new(inner: T) -> Self
pub fn into_inner(self) -> T
pub fn get_mut(&mut self) -> &mut T
pub fn try_lock(&self) -> Option<LockGuard<'_, T>>
pub fn lock(&self) -> LockGuard<'_, T>
pub fn with_lock<F: FnOnce(&mut T) -> R, R>(&self, f: F) -> R
pub fn borrow(&self) -> LockGuard<'_, T>
pub fn borrow_mut(&self) -> LockGuard<'_, T>
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for Lock<T>
impl<T> Send for Lock<T>where
T: Send,
impl<T> !Sync for Lock<T>
impl<T> Unpin for Lock<T>where
T: Unpin,
impl<T> UnwindSafe for Lock<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
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.