DirCmp

Struct DirCmp 

Source
pub struct DirCmp;
Expand description

A struct that manages the comparison of 2 directories. (WIP)

dircmp(a, b, ignore, hide) A and B are directories. IGNORE is a list of names to ignore, defaults to DEFAULT_IGNORES. HIDE is a list of names to hide, defaults to [os.curdir, os.pardir].

High level usage:

  • x = dircmp(dir1, dir2)
    • x.report() -> prints a report on the differences between dir1 and dir2 or
    • x.report_partial_closure() -> prints report on differences between dir1 and dir2, and reports on common immediate subdirectories.
    • x.report_full_closure() -> like report_partial_closure, but fully recursive.

Attributes:

  • left_list, right_list: The files in dir1 and dir2, filtered by hide and ignore.
  • common: a list of names in both dir1 and dir2.
  • left_only, right_only: names only in dir1, dir2.
  • common_dirs: subdirectories in both dir1 and dir2.
  • common_files: files in both dir1 and dir2.
  • common_funny: names in both dir1 and dir2 where the type differs between dir1 and dir2, or the name is not stat-able.
  • same_files: list of identical files.
  • diff_files: list of filenames which differ.
  • funny_files: list of files which could not be compared.
  • subdirs: a dictionary of dircmp objects, keyed by names in common_dirs.

Implementations§

Source§

impl DirCmp

Source

pub fn new(_a: impl AsRef<Path>, _b: impl AsRef<Path>) -> Self

Source

pub fn report_full_closure(&self)

Source

pub fn report(&self)

Auto Trait Implementations§

§

impl Freeze for DirCmp

§

impl RefUnwindSafe for DirCmp

§

impl Send for DirCmp

§

impl Sync for DirCmp

§

impl Unpin for DirCmp

§

impl UnwindSafe for DirCmp

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.