Expand description
File-locking support.
This module defines the Filesystem type which is an abstraction over a
filesystem, ensuring that access to the filesystem is only done through
coordinated locks.
The FileLock type represents a locked file, and provides access to the
file.
Re-exportsΒ§
use std::fs::TryLockError;πuse std::fs::File;πuse std::fs::OpenOptions;πuse std::io;πuse std::io::Read;πuse std::io::Seek;πuse std::io::SeekFrom;πuse std::io::Write;πuse std::path::Display;πuse std::path::Path;πuse std::path::PathBuf;πuse crate::util::GlobalContext;πuse crate::util::errors::CargoResult;πuse crate::util::style;πuse anyhow::Context as _;πuse cargo_util::paths;πpub(crate) use self::imp::lock_exclusive;πpub(crate) use self::imp::try_lock_exclusive;πpub(crate) use self::imp::unlock;π
ModulesΒ§
- imp π
StructsΒ§
- File
Lock - A locked file.
- Filesystem
- A βfilesystemβ is intended to be a globally shared, hence locked, resource in Cargo.
FunctionsΒ§
- acquire π
- Acquires a lock on a file in a βniceβ manner.
- error_
unsupported π - is_
on_ nfs_ mount - try_
acquire π