pub struct QuotaStatus {
pub count: usize,
pub max_worktrees: Option<usize>,
pub total_bytes: u64,
pub disk_quota_bytes: Option<u64>,
pub reclaimed: usize,
pub over_count: bool,
pub over_disk: bool,
}Expand description
Result of one reconcile-and-quota sweep, as returned by
WorktreeManager::sweep.
Carries enough information for a caller to decide whether to surface a status
indicator: QuotaStatus::is_over_quota is true when either the count or
disk-usage threshold configured in WorktreeConfig was exceeded at sweep time.
§Examples
use zeph_worktree::QuotaStatus;
let status = QuotaStatus {
count: 3,
max_worktrees: Some(5),
total_bytes: 1_000_000,
disk_quota_bytes: None,
reclaimed: 0,
over_count: false,
over_disk: false,
};
assert!(!status.is_over_quota());Fields§
§count: usizeNumber of git-registered secondary worktrees under root after reclamation.
max_worktrees: Option<usize>The configured worktree.max_worktrees limit, if set.
total_bytes: u64Total logical disk usage across all worktrees, in bytes, after reclamation.
0 when disk accounting was not performed for this sweep (see
WorktreeManager::sweep’s use of
config.disk_quota_mb to decide whether to walk) — callers must check
disk_quota_bytes.is_some() before treating 0 as a meaningful “no usage” result.
disk_quota_bytes: Option<u64>The configured worktree.disk_quota_mb limit converted to bytes, if set.
reclaimed: usizeNumber of prunable entries automatically removed during this sweep.
over_count: booltrue when count >= max_worktrees (only meaningful if max_worktrees is Some).
over_disk: booltrue when total_bytes >= disk_quota_bytes (only meaningful if
disk_quota_bytes is Some).
Implementations§
Source§impl QuotaStatus
impl QuotaStatus
Sourcepub fn is_over_quota(&self) -> bool
pub fn is_over_quota(&self) -> bool
true if either the worktree-count or disk-usage threshold was exceeded.
§Examples
use zeph_worktree::QuotaStatus;
let status = QuotaStatus {
over_count: true,
..Default::default()
};
assert!(status.is_over_quota());Trait Implementations§
Source§impl Clone for QuotaStatus
impl Clone for QuotaStatus
Source§fn clone(&self) -> QuotaStatus
fn clone(&self) -> QuotaStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more