pub struct LockedRun<'a> { /* private fields */ }Expand description
Compile-time proof that the holder is inside a critical section guarded by
the run’s exclusive flock.
The unlocked append primitives (append_and_apply_unlocked,
append_event_with_seq, quarantine_corrupt_lines_unlocked) take a
&LockedRun so they cannot be called without proof the lock is held —
replacing the old “caller must already hold the RunLock” contract that was
enforced only by a doc comment. Obtain one from
RunLock::with_lock (which threads it into the closure) or
RunLock::witness (for a manually-held RunLock::acquire guard).
The witness is a zero-sized borrow of the guard: its lifetime 'a ties it to
the RunLock it was minted from, so it cannot outlive the lock. It is
deliberately non-Send and non-Sync (the PhantomData<*const …>) — a
proof that this thread holds the flock must not cross a task or thread
boundary, where the lock would no longer apply.