Skip to main content

Module flock

Module flock 

Source
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::lock_shared; πŸ”’
pub(crate) use self::imp::try_lock_exclusive; πŸ”’
pub(crate) use self::imp::try_lock_shared; πŸ”’
pub(crate) use self::imp::unlock; πŸ”’

ModulesΒ§

imp πŸ”’

StructsΒ§

FileLock
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 πŸ”’