pub struct Snapshot(/* private fields */);Expand description
The files under a root at one moment, to diff against a later one.
Taken one of two ways, and compared only with one taken the same way:
- in a git work tree on this machine that does not ignore the root, as a git tree written with a private index and object directory, so the user’s repository is never written to;
- elsewhere, as a scan of what
Workspace::fileslists, with each file’s size, change time and hash.
Either way, the content of each file up to MAX_FILE_BYTES is kept
when the snapshot was taken with somewhere to keep it (Taking::keep).
The files git or files leaves out (ignored, hidden, target) are not
in it, unless named in Taking::also.
Implementations§
Source§impl Snapshot
impl Snapshot
Sourcepub fn changes_since(&self, earlier: &Snapshot) -> Result<Vec<FileChange>>
pub fn changes_since(&self, earlier: &Snapshot) -> Result<Vec<FileChange>>
What changed from earlier to this snapshot, in path order: files
created, modified and deleted, with the FileState of each side.
A snapshot that kept content also gives each change’s diff and line
counts; a scan that kept none gives a modified file’s states only.
§Errors
When the two were taken different ways, or git fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Snapshot
impl RefUnwindSafe for Snapshot
impl Send for Snapshot
impl Sync for Snapshot
impl Unpin for Snapshot
impl UnsafeUnpin for Snapshot
impl UnwindSafe for Snapshot
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