Struct mutiny_core::utils::Mutex
source · pub struct Mutex<T: ?Sized> { /* private fields */ }Implementations§
source§impl<T> Mutex<T>
impl<T> Mutex<T>
pub fn new(inner: T) -> Mutex<T>
pub fn lock(&self) -> LockResult<MutexGuard<'_, T>>
Trait Implementations§
source§impl<'a, T: 'a + ScoreLookUp + ScoreUpdate> LockableScore<'a> for Mutex<T>
impl<'a, T: 'a + ScoreLookUp + ScoreUpdate> LockableScore<'a> for Mutex<T>
§type ScoreUpdate = T
type ScoreUpdate = T
The
ScoreUpdate type.§type ScoreLookUp = T
type ScoreLookUp = T
The
ScoreLookUp type.§type WriteLocked = MutexGuard<'a, <Mutex<T> as LockableScore<'a>>::ScoreUpdate>
type WriteLocked = MutexGuard<'a, <Mutex<T> as LockableScore<'a>>::ScoreUpdate>
The write locked
ScoreUpdate type.§type ReadLocked = MutexGuard<'a, <Mutex<T> as LockableScore<'a>>::ScoreLookUp>
type ReadLocked = MutexGuard<'a, <Mutex<T> as LockableScore<'a>>::ScoreLookUp>
The read locked
ScoreLookUp type.source§fn read_lock(&'a self) -> Self::ReadLocked
fn read_lock(&'a self) -> Self::ReadLocked
Returns read locked scorer.
source§fn write_lock(&'a self) -> Self::WriteLocked
fn write_lock(&'a self) -> Self::WriteLocked
Returns write locked scorer.
source§impl<S: Writeable> Writeable for Mutex<S>
impl<S: Writeable> Writeable for Mutex<S>
impl<T: ?Sized> Send for Mutex<T>
impl<T: ?Sized> Sync for Mutex<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Mutex<T>
impl<T: ?Sized> Unpin for Mutex<T>where T: Unpin,
impl<T: ?Sized> UnwindSafe for Mutex<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more