pub struct Guard { /* private fields */ }Expand description
A held lock; dropping it removes the file, if it is still this one’s.
Implementations§
Source§impl Guard
impl Guard
Sourcepub fn renew(&mut self, now: i64) -> Renewal
pub fn renew(&mut self, now: i64) -> Renewal
Writes the lock anew at now, if it is still this one’s: a holder whose work outlasts one model
call (the session-end judge’s batches, hook.rs judge_session) renews it before each call, so it
never reads stale while its holder still works. Whole, by a rename: no one reads it half-written.
Lost when another holds it now (or it is gone), and nothing is written; Unwritten when it is
still this one’s but could not be written (it stays as it was, and may read stale later).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Guard
impl RefUnwindSafe for Guard
impl Send for Guard
impl Sync for Guard
impl Unpin for Guard
impl UnsafeUnpin for Guard
impl UnwindSafe for Guard
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