pub struct CompactInPlace {
pub verify: bool,
}Expand description
Delegate to znippy’s own compaction, in place.
A thin wrapper over znippy_common::compact_archive and deliberately
nothing more: that function is the one that knows how to copy a live chunk
without touching its codec, and a second copy of that loop in this crate
would be a second thing to keep correct.
The archive keeps its name. An interruption leaves the original serving,
which is compact_archive’s own contract (stage beside, one atomic rename),
asserted in tests/gc_crash.rs by killing a real process mid-copy.
It cannot verify before committing: by the time there is a compacted file to
read, the rename has already replaced the original. The post-hoc check this
runs is therefore a report, not a gate — use NewGeneration when the
difference matters, which is normally.
Fields§
§verify: boolRead the result back and blake3-check it after the rename. On by default; it is a full pass over the archive, so a caller compacting a very large archive on a timer may turn it off.
Implementations§
Trait Implementations§
Source§impl Clone for CompactInPlace
impl Clone for CompactInPlace
Source§fn clone(&self) -> CompactInPlace
fn clone(&self) -> CompactInPlace
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more