pub struct FileConfigSink { /* private fields */ }Expand description
File-backed writable config store.
A reference ConfigSink that persists keys to a flat table on disk.
The on-disk representation is pluggable via Codec:
TOML is the built-in default (FileConfigSink::new),
and any other format (JSON, …) drops in through FileConfigSink::with_codec without changing the sink.
Filesystem access goes through rskit-fs (bounded reads + atomic replacement),
so a concurrent reader never observes a partial write.
Mutations (set/remove/set_many) are read-modify-write sequences serialized by a shared in-process lock,
so concurrent writers — including separate clones, which share the same lock —
never lose each other’s updates. Cross-process coordination is out of scope;
protect the file with OS-level mechanisms if multiple processes write it.
Persisting writes the plaintext value to disk — this is the sink’s explicit, intended persistence. Protect the file with appropriate permissions; the plaintext is never logged.
Implementations§
Source§impl FileConfigSink
impl FileConfigSink
Sourcepub fn new(path: impl Into<PathBuf>) -> Self
pub fn new(path: impl Into<PathBuf>) -> Self
Create a file sink backed by path, using the built-in TOML codec.
The file is created on first write; a missing file reads as empty.
Trait Implementations§
Source§impl Clone for FileConfigSink
impl Clone for FileConfigSink
Source§fn clone(&self) -> FileConfigSink
fn clone(&self) -> FileConfigSink
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more