Struct parking_monitor::Monitor
source · pub struct Monitor<T> { /* private fields */ }
Implementations§
source§impl<T> Monitor<T>
impl<T> Monitor<T>
pub fn new(t: T) -> Self
pub fn lock(&self) -> MonitorGuard<'_, T>
pub fn try_lock(&self) -> Option<MonitorGuard<'_, T>>
pub fn try_lock_for(&self, timeout: Duration) -> Option<MonitorGuard<'_, T>>
pub fn try_lock_until(&self, timeout: Instant) -> Option<MonitorGuard<'_, T>>
pub fn with_lock<U, F>(&self, f: F) -> Uwhere F: FnOnce(MonitorGuard<'_, T>) -> U,
pub fn try_with_lock<U, F>(&self, f: F) -> Option<U>where F: FnOnce(MonitorGuard<'_, T>) -> U,
pub fn try_with_lock_for<U, F>(&self, timeout: Duration, f: F) -> Option<U>where F: FnOnce(MonitorGuard<'_, T>) -> U,
pub fn try_with_lock_until<U, F>(&self, timeout: Instant, f: F) -> Option<U>where F: FnOnce(MonitorGuard<'_, T>) -> U,
pub fn into_inner(self) -> T
pub fn get_mut(&mut self) -> &mut T
pub unsafe fn raw(&self) -> &RawMutex
pub unsafe fn force_unlock(&self)
pub unsafe fn force_unlock_fair(&self)
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Monitor<T>
impl<T> Send for Monitor<T>where T: Send,
impl<T> Sync for Monitor<T>where T: Send,
impl<T> Unpin for Monitor<T>where T: Unpin,
impl<T> UnwindSafe for Monitor<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