pub struct ReadLock(/* private fields */);Expand description
ReadLock: the requests who get it need to wait until it is released
Implementations§
Source§impl ReadLock
impl ReadLock
Sourcepub async fn wait_unless_published(
&self,
unusable: &UnusableFills,
) -> WaitOutcome
pub async fn wait_unless_published( &self, unusable: &UnusableFills, ) -> WaitOutcome
Wait for the writer to release the lock, unless it publishes a fill in
unusable first — which lets a reader act on what the writer only learns
after the reader committed to waiting.
Giving up is local to this reader: the lock status is untouched and every other reader goes on coalescing. Tokens never published never match.
Sourcepub fn expired(&self) -> bool
pub fn expired(&self) -> bool
Whether the lock is expired, e.g., the writer has been holding the lock for too long
Sourcepub fn lock_status(&self) -> LockStatus
pub fn lock_status(&self) -> LockStatus
The current status of the lock
pub fn extensions(&self) -> &Extensions
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ReadLock
impl !UnwindSafe for ReadLock
impl Freeze for ReadLock
impl Send for ReadLock
impl Sync for ReadLock
impl Unpin for ReadLock
impl UnsafeUnpin for ReadLock
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