pub struct FileChangeSet { /* private fields */ }Expand description
A collection of file changes with convenience accessors.
Implementations§
Source§impl FileChangeSet
impl FileChangeSet
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a new file change set with capacity.
Sourcepub fn push(&mut self, change: FileChange)
pub fn push(&mut self, change: FileChange)
Add a file change.
Sourcepub fn push_added(&mut self, path: impl Into<String>)
pub fn push_added(&mut self, path: impl Into<String>)
Add an added file change.
Sourcepub fn push_modified(&mut self, path: impl Into<String>)
pub fn push_modified(&mut self, path: impl Into<String>)
Add a modified file change.
Sourcepub fn push_deleted(&mut self, path: impl Into<String>)
pub fn push_deleted(&mut self, path: impl Into<String>)
Add a deleted file change.
Sourcepub fn iter(&self) -> impl Iterator<Item = &FileChange>
pub fn iter(&self) -> impl Iterator<Item = &FileChange>
Returns an iterator over the changes.
Sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = &mut FileChange>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut FileChange>
Returns a mutable iterator over the changes.
Sourcepub fn into_vec(self) -> Vec<FileChange>
pub fn into_vec(self) -> Vec<FileChange>
Consume and return the underlying vector.
Sourcepub fn added(&self) -> impl Iterator<Item = &FileChange>
pub fn added(&self) -> impl Iterator<Item = &FileChange>
Get only added files.
Sourcepub fn modified(&self) -> impl Iterator<Item = &FileChange>
pub fn modified(&self) -> impl Iterator<Item = &FileChange>
Get only modified files.
Sourcepub fn deleted(&self) -> impl Iterator<Item = &FileChange>
pub fn deleted(&self) -> impl Iterator<Item = &FileChange>
Get only deleted files.
Sourcepub fn added_count(&self) -> usize
pub fn added_count(&self) -> usize
Returns the number of added files.
Sourcepub fn modified_count(&self) -> usize
pub fn modified_count(&self) -> usize
Returns the number of modified files.
Sourcepub fn deleted_count(&self) -> usize
pub fn deleted_count(&self) -> usize
Returns the number of deleted files.
Trait Implementations§
Source§impl Clone for FileChangeSet
impl Clone for FileChangeSet
Source§fn clone(&self) -> FileChangeSet
fn clone(&self) -> FileChangeSet
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 FileChangeSet
impl Debug for FileChangeSet
Source§impl Default for FileChangeSet
impl Default for FileChangeSet
Source§fn default() -> FileChangeSet
fn default() -> FileChangeSet
Returns the “default value” for a type. Read more
Source§impl Extend<FileChange> for FileChangeSet
impl Extend<FileChange> for FileChangeSet
Source§fn extend<T: IntoIterator<Item = FileChange>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = FileChange>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl From<Vec<FileChange>> for FileChangeSet
impl From<Vec<FileChange>> for FileChangeSet
Source§fn from(changes: Vec<FileChange>) -> Self
fn from(changes: Vec<FileChange>) -> Self
Converts to this type from the input type.
Source§impl IntoIterator for FileChangeSet
impl IntoIterator for FileChangeSet
Source§impl<'a> IntoIterator for &'a FileChangeSet
impl<'a> IntoIterator for &'a FileChangeSet
Auto Trait Implementations§
impl Freeze for FileChangeSet
impl RefUnwindSafe for FileChangeSet
impl Send for FileChangeSet
impl Sync for FileChangeSet
impl Unpin for FileChangeSet
impl UnsafeUnpin for FileChangeSet
impl UnwindSafe for FileChangeSet
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