pub struct DocumentMaintenanceStatus { /* private fields */ }Expand description
Snapshot of maintenance-oriented document state such as fragmentation and compaction advice.
Implementations§
Source§impl DocumentMaintenanceStatus
impl DocumentMaintenanceStatus
Sourcepub const fn new(
backing: DocumentBacking,
fragmentation: Option<FragmentationStats>,
compaction: Option<CompactionRecommendation>,
) -> Self
pub const fn new( backing: DocumentBacking, fragmentation: Option<FragmentationStats>, compaction: Option<CompactionRecommendation>, ) -> Self
Creates a maintenance status snapshot.
Sourcepub const fn backing(self) -> DocumentBacking
pub const fn backing(self) -> DocumentBacking
Returns the current document backing mode.
Sourcepub const fn has_piece_table(self) -> bool
pub const fn has_piece_table(self) -> bool
Returns true when the document currently uses a piece table.
Sourcepub const fn fragmentation_stats(self) -> Option<FragmentationStats>
pub const fn fragmentation_stats(self) -> Option<FragmentationStats>
Returns fragmentation metrics when they are meaningful for the current backing.
Sourcepub const fn has_fragmentation_stats(self) -> bool
pub const fn has_fragmentation_stats(self) -> bool
Returns true when fragmentation metrics are available.
Sourcepub const fn compaction_recommendation(self) -> Option<CompactionRecommendation>
pub const fn compaction_recommendation(self) -> Option<CompactionRecommendation>
Returns the current compaction recommendation, if any.
Sourcepub const fn is_compaction_recommended(self) -> bool
pub const fn is_compaction_recommended(self) -> bool
Returns true when the current maintenance policy recommends compaction.
Sourcepub fn compaction_urgency(self) -> Option<CompactionUrgency>
pub fn compaction_urgency(self) -> Option<CompactionUrgency>
Returns the current compaction urgency, if a recommendation exists.
Sourcepub fn recommended_action(self) -> MaintenanceAction
pub fn recommended_action(self) -> MaintenanceAction
Returns the high-level maintenance action implied by this snapshot.
Sourcepub fn should_run_idle_compaction(self) -> bool
pub fn should_run_idle_compaction(self) -> bool
Returns true when idle compaction is currently recommended.
Sourcepub fn should_wait_for_explicit_compaction(self) -> bool
pub fn should_wait_for_explicit_compaction(self) -> bool
Returns true when heavier maintenance should be deferred to an
explicit operator/save boundary.
Trait Implementations§
Source§impl Clone for DocumentMaintenanceStatus
impl Clone for DocumentMaintenanceStatus
Source§fn clone(&self) -> DocumentMaintenanceStatus
fn clone(&self) -> DocumentMaintenanceStatus
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more