Struct more_sync::VersionedGuard
source · [−]pub struct VersionedGuard<'a, T> { /* private fields */ }
Expand description
Mutex guard returned by VersionedParker::lock
.
Implementations
sourceimpl<'a, T> VersionedGuard<'a, T>
impl<'a, T> VersionedGuard<'a, T>
sourcepub fn version(&self) -> usize
pub fn version(&self) -> usize
Returns the current version.
The version will not change unless wait()
or
wait_timeout()
is called.
sourcepub fn notified(&self) -> bool
pub fn notified(&self) -> bool
Returns if we were notified during last period.
If we never waited, notified()
returns false.
sourcepub fn notified_count(&self) -> usize
pub fn notified_count(&self) -> usize
Returns the number of times we were notified during last wait.
If we never waited, notification_count()
returns 0.
sourcepub fn wait(&mut self)
pub fn wait(&mut self)
Blocks the current thread until notified.
wait()
updates the version stored in this guard.
sourcepub fn wait_timeout(&mut self, timeout: Duration) -> WaitTimeoutResult
pub fn wait_timeout(&mut self, timeout: Duration) -> WaitTimeoutResult
Blocks the current thread until notified, for up to timeout
.
wait_timeout()
updates the version stored in this guard.
Trait Implementations
sourceimpl<'a, T: Debug> Debug for VersionedGuard<'a, T>
impl<'a, T: Debug> Debug for VersionedGuard<'a, T>
sourceimpl<'a, T> Deref for VersionedGuard<'a, T>
impl<'a, T> Deref for VersionedGuard<'a, T>
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for VersionedGuard<'a, T>
impl<'a, T> !Send for VersionedGuard<'a, T>
impl<'a, T> Sync for VersionedGuard<'a, T>where
T: Send + Sync,
impl<'a, T> Unpin for VersionedGuard<'a, T>
impl<'a, T> UnwindSafe for VersionedGuard<'a, T>
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