pub struct VersionedGuard<'a, T> { /* private fields */ }
Expand description
Mutex guard returned by VersionedParker::lock
.
Implementations§
Source§impl<'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§
Source§impl<'a, T: Debug> Debug for VersionedGuard<'a, T>
impl<'a, T: Debug> Debug for VersionedGuard<'a, T>
Source§impl<'a, T> Deref for VersionedGuard<'a, T>
impl<'a, T> Deref for VersionedGuard<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for VersionedGuard<'a, T>
impl<'a, T> RefUnwindSafe for VersionedGuard<'a, T>
impl<'a, T> !Send for VersionedGuard<'a, T>
impl<'a, T> Sync for VersionedGuard<'a, T>
impl<'a, T> Unpin for VersionedGuard<'a, T>
impl<'a, T> UnwindSafe for VersionedGuard<'a, T>
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