pub struct WritePermit { /* private fields */ }Expand description
WritePermit: requires who get it need to populate the cache and then release it
Implementations§
Source§impl WritePermit
impl WritePermit
Sourcepub fn new(
timeout: Duration,
stale_writer: bool,
extensions: Extensions,
) -> (WritePermit, LockStub)
pub fn new( timeout: Duration, stale_writer: bool, extensions: Extensions, ) -> (WritePermit, LockStub)
Create a new lock, with a permit to be given to the associated writer.
Sourcepub fn stale_writer(&self) -> bool
pub fn stale_writer(&self) -> bool
Was this lock for a stale cache fetch writer?
pub fn unlock(&mut self, reason: LockStatus)
pub fn lock_status(&self) -> LockStatus
pub fn extensions(&self) -> &Extensions
Sourcepub fn publish(&self, tokens: &[u64])
pub fn publish(&self, tokens: &[u64])
Describe what this fill involves, so readers that cannot use it stop waiting. Tokens are opaque: writer and readers need only agree on meaning.
Each call replaces the previous description, since a writer that moved on is no longer doing what it said and a reader giving up over an abandoned attempt would lose its caching for nothing. Empty describes nothing. Only matching readers are woken.
Trait Implementations§
Source§impl Debug for WritePermit
impl Debug for WritePermit
Source§impl Drop for WritePermit
impl Drop for WritePermit
Auto Trait Implementations§
impl !RefUnwindSafe for WritePermit
impl !UnwindSafe for WritePermit
impl Freeze for WritePermit
impl Send for WritePermit
impl Sync for WritePermit
impl Unpin for WritePermit
impl UnsafeUnpin for WritePermit
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