pub struct PatchSet {
pub workspace_id: WorkspaceId,
pub epoch: EpochId,
pub changes: Vec<FileChange>,
}Expand description
All changes from a single workspace relative to the epoch base.
Changes are sorted by path on construction for determinism.
An empty PatchSet represents a workspace with no changes — these
are included in collect output (not skipped) so the caller can
handle them explicitly.
Fields§
§workspace_id: WorkspaceIdThe workspace these changes came from.
epoch: EpochIdThe epoch commit this workspace is based on.
changes: Vec<FileChange>File changes sorted by path for determinism.
Implementations§
Source§impl PatchSet
impl PatchSet
Sourcepub fn new(
workspace_id: WorkspaceId,
epoch: EpochId,
changes: Vec<FileChange>,
) -> Self
pub fn new( workspace_id: WorkspaceId, epoch: EpochId, changes: Vec<FileChange>, ) -> Self
Create a new PatchSet, sorting changes by path for determinism.
Sourcepub const fn change_count(&self) -> usize
pub const fn change_count(&self) -> usize
Total count of all changes.
Sourcepub fn added_count(&self) -> usize
pub fn added_count(&self) -> usize
Count of added files.
Sourcepub fn modified_count(&self) -> usize
pub fn modified_count(&self) -> usize
Count of modified files.
Sourcepub fn deleted_count(&self) -> usize
pub fn deleted_count(&self) -> usize
Count of deleted files.
Sourcepub fn is_deletion_only(&self) -> bool
pub fn is_deletion_only(&self) -> bool
Returns true if this workspace only has deletions (no additions or modifications).
Useful for the caller to detect deletion-only workspaces, which are valid but may require special treatment in merge resolution.