Skip to main content

choir_fs/
lib.rs

1//! Durable-file utilities shared by the binaries (internal/oak.md item 6):
2//! atomic replace-by-rename writes, a private variant for secrets, and a
3//! PID-bearing directory lock that enforces one writer process.
4//!
5//! Ported from Oak (oak.space) `cli/src/atomic_file.rs` and
6//! `cli/src/workdir_lock.rs`, v0.102.1 (commit `8de9515`), Apache-2.0;
7//! adapted to std errors and this workspace's needs.
8//!
9//! # Where this sits
10//!
11//! `docs/architecture.md` is the map of the whole workspace.
12//! This crate is the durable-file primitives — atomic writes and a working-directory lock — that the binaries share.
13//!
14//! It depends on no other crate in this workspace.
15
16pub mod atomic_file;
17pub mod workdir_lock;
18
19pub use atomic_file::{write_atomic, write_atomic_private};
20pub use workdir_lock::{LockError, WorkdirLock};