pub struct GitChangeSnapshot {
pub changes: Vec<GitFileChange>,
pub captured_at: Option<Instant>,
}Expand description
Snapshot of git changes for an entire repository.
Fields§
§changes: Vec<GitFileChange>All detected changes.
captured_at: Option<Instant>Timestamp when this snapshot was taken.
Implementations§
Source§impl GitChangeSnapshot
impl GitChangeSnapshot
Sourcepub fn has_changes(&self, path: &Path) -> bool
pub fn has_changes(&self, path: &Path) -> bool
Check if a path has any changes.
Sourcepub fn get_change(&self, path: &Path) -> Option<&GitFileChange>
pub fn get_change(&self, path: &Path) -> Option<&GitFileChange>
Get the change kind for a path, if any.
Sourcepub fn changed_paths(&self) -> impl Iterator<Item = &Path>
pub fn changed_paths(&self) -> impl Iterator<Item = &Path>
Get all paths that have changes.
Sourcepub fn count_by_kind(&self, kind: GitChangeKind) -> usize
pub fn count_by_kind(&self, kind: GitChangeKind) -> usize
Count changes by kind.
Trait Implementations§
Source§impl Clone for GitChangeSnapshot
impl Clone for GitChangeSnapshot
Source§fn clone(&self) -> GitChangeSnapshot
fn clone(&self) -> GitChangeSnapshot
Returns a duplicate of the value. Read more
1.0.0 · 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 GitChangeSnapshot
impl Debug for GitChangeSnapshot
Source§impl Default for GitChangeSnapshot
impl Default for GitChangeSnapshot
Source§fn default() -> GitChangeSnapshot
fn default() -> GitChangeSnapshot
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GitChangeSnapshot
impl<'de> Deserialize<'de> for GitChangeSnapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GitChangeSnapshot
impl RefUnwindSafe for GitChangeSnapshot
impl Send for GitChangeSnapshot
impl Sync for GitChangeSnapshot
impl Unpin for GitChangeSnapshot
impl UnwindSafe for GitChangeSnapshot
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