pub struct BuildCache { /* private fields */ }Expand description
The shared build cache. Cloning shares it.
Implementations§
Source§impl BuildCache
impl BuildCache
Sourcepub fn open(
directory: &Path,
sockets: &Path,
max_size: u64,
) -> Result<BuildCache>
pub fn open( directory: &Path, sockets: &Path, max_size: u64, ) -> Result<BuildCache>
Opens the build cache in directory, counting the entries an earlier run left, with each runner’s socket
under sockets.
Sourcepub fn directory(&self) -> &Path
pub fn directory(&self) -> &Path
Where the entries are: entries in the build cache’s directory.
Sourcepub fn set_max_size(&self, max_size: u64)
pub fn set_max_size(&self, max_size: u64)
Sets the size trim brings it under.
Sourcepub fn attach(&self, runner: &str, repository: &str) -> Result<PathBuf>
pub fn attach(&self, runner: &str, repository: &str) -> Result<PathBuf>
Opens runner’s socket for a job of repository and returns the directory its container mounts at MOUNT.
A runner already open, as after a restart, gets its socket back in the directory its container mounts.
Sourcepub fn forget_others(&self, keep: &[&str])
pub fn forget_others(&self, keep: &[&str])
Removes the socket directories of runners not in keep, which an earlier run left.
Sourcepub fn decide(&self, runner: &str, writes: Writes)
pub fn decide(&self, runner: &str, writes: Writes)
Decides whether runner’s job may write, once: what it sent meanwhile becomes entries or is dropped.
Sourcepub fn close(&self, runner: &str) -> bool
pub fn close(&self, runner: &str) -> bool
Closes the socket of runner if its writes are undecided and it holds uploads, and says whether it did: the
uploads stay until decide and detach.
Sourcepub fn detach(&self, runner: &str) -> Option<BuildCacheCounts>
pub fn detach(&self, runner: &str) -> Option<BuildCacheCounts>
Closes runner’s socket and returns what it was served and stored, and whether it could write. What it sent
while undecided is dropped.