pub struct WorktreeDiskUsage {
pub total_bytes: u64,
pub per_worktree: Vec<(PathBuf, u64)>,
}Expand description
Total and per-worktree disk usage, as computed by
WorktreeManager::disk_usage.
total_bytes is a sum of logical file sizes (std::fs::Metadata::len) across
every regular file under each worktree’s directory tree — not on-disk block
usage. Content shared via hardlinks across worktrees (e.g. zeph-session blobs)
can be double-counted, so treat this as an approximation suitable for a soft
warn threshold, not exact du output.
§Examples
use zeph_worktree::WorktreeDiskUsage;
let usage = WorktreeDiskUsage {
total_bytes: 1024,
per_worktree: vec![(std::path::PathBuf::from("/repo/worktrees/agent-1"), 1024)],
};
assert_eq!(usage.total_bytes, 1024);Fields§
§total_bytes: u64Sum of logical file sizes across every worktree under root.
per_worktree: Vec<(PathBuf, u64)>Per-worktree logical size, in the same order reconcile() + list()
returned them.
Trait Implementations§
Source§impl Clone for WorktreeDiskUsage
impl Clone for WorktreeDiskUsage
Source§fn clone(&self) -> WorktreeDiskUsage
fn clone(&self) -> WorktreeDiskUsage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorktreeDiskUsage
impl Debug for WorktreeDiskUsage
Source§impl Default for WorktreeDiskUsage
impl Default for WorktreeDiskUsage
Source§fn default() -> WorktreeDiskUsage
fn default() -> WorktreeDiskUsage
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for WorktreeDiskUsage
impl RefUnwindSafe for WorktreeDiskUsage
impl Send for WorktreeDiskUsage
impl Sync for WorktreeDiskUsage
impl Unpin for WorktreeDiskUsage
impl UnsafeUnpin for WorktreeDiskUsage
impl UnwindSafe for WorktreeDiskUsage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more