pub struct OptimizedMutex<T> { /* private fields */ }
Expand description
Optimized mutex with performance monitoring
Implementations§
Source§impl<T> OptimizedMutex<T>
impl<T> OptimizedMutex<T>
Sourcepub fn lock(&self) -> OptimizedMutexGuard<'_, T>
pub fn lock(&self) -> OptimizedMutexGuard<'_, T>
Lock the mutex with performance monitoring
Sourcepub fn try_lock(&self) -> Option<OptimizedMutexGuard<'_, T>>
pub fn try_lock(&self) -> Option<OptimizedMutexGuard<'_, T>>
Try to lock the mutex without blocking
Sourcepub fn try_lock_for(
&self,
timeout: Duration,
) -> Option<OptimizedMutexGuard<'_, T>>
pub fn try_lock_for( &self, timeout: Duration, ) -> Option<OptimizedMutexGuard<'_, T>>
Try to lock with a timeout
Sourcepub fn performance_stats(&self) -> PerformanceSnapshot
pub fn performance_stats(&self) -> PerformanceSnapshot
Get performance statistics for this mutex
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for OptimizedMutex<T>
impl<T> !RefUnwindSafe for OptimizedMutex<T>
impl<T> Send for OptimizedMutex<T>where
T: Send,
impl<T> Sync for OptimizedMutex<T>where
T: Send,
impl<T> Unpin for OptimizedMutex<T>where
T: Unpin,
impl<T> UnwindSafe for OptimizedMutex<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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more