pub struct LockStore { /* private fields */ }Expand description
Reader/writer for usage.lock.
Implementations§
Source§impl LockStore
impl LockStore
pub fn new(root: PathBuf) -> Self
pub fn path(&self) -> PathBuf
Sourcepub fn read(&self) -> Result<Option<Lock>, CacheError>
pub fn read(&self) -> Result<Option<Lock>, CacheError>
Return the current lock, the legacy-mtime fallback, or
Ok(None) for absence. blocked_until is capped at
now + MAX_LOCK_DURATION_SECS so a pathological on-disk
value can’t park the orchestrator indefinitely. Non-UTF-8 or
non-JSON contents route through the legacy mtime fallback
per docs/specs/data-fetching.md §Lock file shape.
Unexpected I/O errors surface as Err.
pub fn write(&self, lock: &Lock) -> Result<(), CacheError>
Auto Trait Implementations§
impl Freeze for LockStore
impl RefUnwindSafe for LockStore
impl Send for LockStore
impl Sync for LockStore
impl Unpin for LockStore
impl UnsafeUnpin for LockStore
impl UnwindSafe for LockStore
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