1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Single-shot compaction exposed under the [`compact_step`] entry point.
//!
//! Compaction shrinks main.db by rebuilding it atomically (scratch file +
//! rename — see [`super::repack`]). A full rewrite cannot be safely chunked
//! across writer-lock releases: commits made by other writers between chunks
//! would be silently dropped by the final rename. So `compact_step` performs the
//! whole atomic compaction in a single call and reports completion.
//!
//! This is not a limitation of reclamation in general — sustained-write growth
//! is bounded continuously by the durable free-list (every commit reuses freed
//! pages), so returning space to the OS is a maintenance operation rather than a
//! hot path.
use crateResult;
use crateDb;
use crateVfs;
use ;
/// Run a full compaction and report what it reclaimed.
///
/// `budget` is accepted for interface stability with the incremental-style API
/// but does not chunk the work (see the module docs for why a full rewrite can't
/// be safely chunked). Compaction runs atomically to completion and always
/// returns `more_work = false`; to reclaim periodically, call this again later.
///
/// Returns `PagedbError::WrongMode` if the handle is not in `Standalone` mode.
pub async