pub struct DiffStat { /* private fields */ }Expand description
Per-file line counts plus totals for a whole diff.
Implementations§
Source§impl DiffStat
impl DiffStat
Sourcepub fn new(files: Vec<FileStat>) -> Self
pub fn new(files: Vec<FileStat>) -> Self
Build a diffstat from file rows, summing their counts into totals.
§Parameters
files: rows in display order.
Sourcepub fn from_files(files: &[FileDiff]) -> Self
pub fn from_files(files: &[FileDiff]) -> Self
Build a diffstat from listed file diffs at any detail level.
Each row’s counts come from FileDiff::line_stat.
§Parameters
files: listed file diffs, in display order.
Sourcepub fn totals(&self) -> DiffTotals
pub fn totals(&self) -> DiffTotals
Changed-file count and line totals across all rows.
Sourcepub fn max_changes(&self) -> usize
pub fn max_changes(&self) -> usize
The largest per-file change count: the scale for LineStat::bar.
Sourcepub fn into_files(self) -> Vec<FileStat>
pub fn into_files(self) -> Vec<FileStat>
Take the file rows, dropping the totals.
Trait Implementations§
impl Eq for DiffStat
Source§impl FromIterator<FileStat> for DiffStat
impl FromIterator<FileStat> for DiffStat
impl StructuralPartialEq for DiffStat
Auto Trait Implementations§
impl Freeze for DiffStat
impl RefUnwindSafe for DiffStat
impl Send for DiffStat
impl Sync for DiffStat
impl Unpin for DiffStat
impl UnsafeUnpin for DiffStat
impl UnwindSafe for DiffStat
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.