/// Writes the report in human-readable text format.
///
/// A group of identical files starts with a group header at column 0,
/// containing the size and hash of each file in the group.
/// Then file paths are printed in separate, indented lines.
///
/// # Example
/// ```text
/// # Report by fclones 0.12.0
/// # Timestamp: Mon, 03 May 2021 13:22:51 +0000
/// # Command: target/debug/fclones find . -o report.txt
/// # Found 553 file groups
/// # 271.8 MB in 4266 redundant files can be removed
/// 5649a555c131508c4a757d9e14c4aea6, 6626689 B (6.6 MB) * 5:
///     /home/pkolaczk/Projekty/fclones/target/debug/deps/libregex_syntax-94c84f5600b85f6e.rmeta
///     /home/pkolaczk/Projekty/fclones/target/package/fclones-0.10.0/target/debug/deps/libregex_syntax-94c84f5600b85f6e.rmeta
///     /home/pkolaczk/Projekty/fclones/target/package/fclones-0.10.1/target/debug/deps/libregex_syntax-94c84f5600b85f6e.rmeta
///     /home/pkolaczk/Projekty/fclones/target/package/fclones-0.10.2/target/debug/deps/libregex_syntax-94c84f5600b85f6e.rmeta
///     /home/pkolaczk/Projekty/fclones/target/package/fclones-0.11.0/target/debug/deps/libregex_syntax-94c84f5600b85f6e.rmeta
/// f79ce189d76620fd921986943087dc3a, 5815999 B (5.8 MB) * 5:
///     /home/pkolaczk/Projekty/fclones/target/debug/deps/libserde-af05e0212e5def7d.rmeta
///     /home/pkolaczk/Projekty/fclones/target/package/fclones-0.10.0/target/debug/deps/libserde-af05e0212e5def7d.rmeta
///     /home/pkolaczk/Projekty/fclones/target/package/fclones-0.10.1/target/debug/deps/libserde-af05e0212e5def7d.rmeta
///     /home/pkolaczk/Projekty/fclones/target/package/fclones-0.10.2/target/debug/deps/libserde-af05e0212e5def7d.rmeta
///     /home/pkolaczk/Projekty/fclones/target/package/fclones-0.11.0/target/debug/deps/libserde-af05e0212e5def7d.rmeta
/// ```
Writes the report in human-readable text format.
A group of identical files starts with a group header at column 0,
containing the size and hash of each file in the group.
Then file paths are printed in separate, indented lines.
Writes the report in human - readable text format . A group of identical files starts with a group header at column 0 containing the size and hash of each file in the group . Then file paths are printed in separate indented lines .
pub fn write_as_text<I, G, P>(&mut self, header: &ReportHeader, groups: I) -> io::Result<()>
    where
        I: IntoIterator<Item = G>,
        G: Borrow<FileGroup<P>>,
        P: Display,
    {
        let command = shell_words::join(header.command.iter());
        self.write_header_line(&format!("Report by fclones {}", header.version))?;
        self.write_header_line(&format!(
            "Timestamp: {}",
            header.timestamp.format(TIMESTAMP_FMT)
        ))?;
        self.write_header_line(&format!("Command: {}", command))?;
        if let Some(stats) = &header.stats {
            self.write_header_line(&format!("Found {} file groups", stats.group_count))?;
            self.write_header_line(&format!(
                "{} B ({}) in {} redundant files can be removed",
                stats.redundant_file_size.0, stats.redundant_file_size, stats.redundant_file_count
            ))?;
        }
        for g in groups {
            let g = g.borrow();
            let group_header = format!(
                "{}, {} B ({}) * {}:",
                g.file_hash,
                g.file_len.0,
                g.file_len,
                g.files.len()
            );
            let group_header = style(group_header).yellow();
            writeln!(self.out, "{}", group_header.force_styling(self.color),)?;
            for f in g.files.iter() {
                writeln!(self.out, "    {}", f)?;
            }
        }
        Ok(())
    }
pub fn write_as_text < I , G , P > ( & mut self , header : & ReportHeader , groups : I ) -> io :: Result < ( ) > where I : IntoIterator < Item = G > , G : Borrow < FileGroup < P > > , P : Display , { let command = shell_words :: join ( header . command . iter ( ) ) ; self . write_header_line ( & format ! ( " " header version ) ) ? ; self . write_header_line ( & format ! ( " " header timestamp format ( TIMESTAMP_FMT ) ) ) ? ; self . write_header_line ( & format ! ( " " command ) ) ? ; if let Some ( stats ) = & header . stats { self . write_header_line ( & format ! ( " " stats group_count ) ) ? ; self . write_header_line ( & format ! ( " " stats redundant_file_size 0 stats redundant_file_size stats redundant_file_count ) ) ? ; } for g in groups { let g = g . borrow ( ) ; let group_header = format ! ( " " g file_hash g file_len 0 g file_len g files len ( ) ) ; let group_header = style ( group_header ) . yellow ( ) ; writeln ! ( self out " " group_header force_styling ( self color ) ) ? ; for f in g . files . iter ( ) { writeln ! ( self out " " f ) ? ; } } Ok ( ( ) ) }
Writes the report in human-readable text format.
Writes the report in human - readable text format .
&mut self
header
&ReportHeader
groups
I
example
None
report by fclones 0.12.0
None
timestamp: mon, 03 may 2021 13:22:51 +0000
None
command: target/debug/fclones find . -o report.txt
None
found 553 file groups
None
271.8 mb in 4266 redundant files can be removed
None