pub struct LockedLockfile { /* private fields */ }Expand description
A module-lock.json held under its exclusive advisory lock.
The lock is released when this value is dropped, or when
Self::write consumes it.
Implementations§
Source§impl LockedLockfile
impl LockedLockfile
Sourcepub fn read(path: &Path) -> Result<Option<Lockfile>, ProjectError>
pub fn read(path: &Path) -> Result<Option<Lockfile>, ProjectError>
Reads and parses the module-lock.json at path under a shared
advisory lock.
Returns Ok(None) when the file is absent or empty. The file is never
created, so reading cannot make a project appear to have a lockfile.
Sourcepub fn acquire(path: &Path) -> Result<Self, ProjectError>
pub fn acquire(path: &Path) -> Result<Self, ProjectError>
Acquires the exclusive advisory lock on the module-lock.json at
path, creating the file when it is absent.
This blocks until any other holder releases the lock.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LockedLockfile
impl RefUnwindSafe for LockedLockfile
impl Send for LockedLockfile
impl Sync for LockedLockfile
impl Unpin for LockedLockfile
impl UnsafeUnpin for LockedLockfile
impl UnwindSafe for LockedLockfile
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