pub struct FileDiff {
pub main_changes: Option<ConfigDiff>,
pub repos_added: Vec<RepoId>,
pub repos_removed: Vec<RepoId>,
pub repos_modified: IndexMap<RepoId, RepoDiff>,
pub repos_unchanged: Vec<RepoId>,
pub has_changes: bool,
}Expand description
Result of comparing two entire .repo files.
Reports added, removed, modified, and unchanged repos, plus any changes
to the [main] section.
§Examples
use dnf_repofile::{RepoFile, diff_files};
let a = RepoFile::parse("[repo]\nname=Old\nbaseurl=https://a.com/\n").unwrap();
let b = RepoFile::parse("[repo]\nname=New\nbaseurl=https://b.com/\n").unwrap();
let diff = diff_files(&a, &b);
assert!(diff.has_changes);Fields§
§main_changes: Option<ConfigDiff>Changes to the [main] section, if present.
repos_added: Vec<RepoId>Repo IDs present in B but not in A.
repos_removed: Vec<RepoId>Repo IDs present in A but not in B.
repos_modified: IndexMap<RepoId, RepoDiff>Repo IDs present in both files with field-level changes.
repos_unchanged: Vec<RepoId>Repo IDs present in both files with identical values.
has_changes: boolWhether any changes were detected across all categories.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FileDiff
impl RefUnwindSafe for FileDiff
impl Send for FileDiff
impl Sync for FileDiff
impl Unpin for FileDiff
impl UnsafeUnpin for FileDiff
impl UnwindSafe for FileDiff
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