pub fn write_as_csv<I, G, P>(&mut self, _header: &ReportHeader, groups: I) -> io::Result<()>
    where
        I: IntoIterator<Item = G>,
        G: Borrow<FileGroup<P>>,
        P: Display,
    {
        let mut wtr = csv::WriterBuilder::new()
            .delimiter(b',')
            .quote_style(csv::QuoteStyle::Necessary)
            .flexible(true)
            .from_writer(&mut self.out);

        wtr.write_record(&["size", "hash", "count", "files"])?;
        for g in groups {
            let g = g.borrow();
            let mut record = csv::StringRecord::new();
            record.push_field(g.file_len.0.to_string().as_str());
            record.push_field(g.file_hash.to_string().as_str());
            record.push_field(g.files.len().to_string().as_str());
            for f in g.files.iter() {
                record.push_field(format!("{}", f).as_ref());
            }
            wtr.write_record(&record)?;
        }
        wtr.flush()
    }
/// Writes results in CSV format.
///
/// Each file group is written as one line.
/// The number of columns is dynamic.
/// Columns:
/// - file size in bytes
/// - file hash (may be empty)
/// - number of files in the group
/// - file paths - each file in a separate column
Writes results in CSV format.
Each file group is written as one line.
The number of columns is dynamic.
Columns:
file size in bytes
file hash (may be empty)
number of files in the group
file paths - each file in a separate column
Writes results in CSV format . Each file group is written as one line . The number of columns is dynamic . Columns : file size in bytes file hash ( may be empty ) number of files in the group file paths - each file in a separate column
pub fn write_as_csv<I, G, P>(&mut self, _header: &ReportHeader, groups: I) -> io::Result<()>
    where
        I: IntoIterator<Item = G>,
        G: Borrow<FileGroup<P>>,
        P: Display,
    {
        let mut wtr = csv::WriterBuilder::new()
            .delimiter(b',')
            .quote_style(csv::QuoteStyle::Necessary)
            .flexible(true)
            .from_writer(&mut self.out);
        wtr.write_record(&["size", "hash", "count", "files"])?;
        for g in groups {
            let g = g.borrow();
            let mut record = csv::StringRecord::new();
            record.push_field(g.file_len.0.to_string().as_str());
            record.push_field(g.file_hash.to_string().as_str());
            record.push_field(g.files.len().to_string().as_str());
            for f in g.files.iter() {
                record.push_field(format!("{}", f).as_ref());
            }
            wtr.write_record(&record)?;
        }
        wtr.flush()
    }
pub fn write_as_csv < I , G , P > ( & mut self , _header : & ReportHeader , groups : I ) -> io :: Result < ( ) > where I : IntoIterator < Item = G > , G : Borrow < FileGroup < P > > , P : Display , { let mut wtr = csv :: WriterBuilder :: new ( ) . delimiter ( b',' ) . quote_style ( csv :: QuoteStyle :: Necessary ) . flexible ( true ) . from_writer ( & mut self . out ) ; wtr . write_record ( & [ " " , " " , " " , " " ] ) ? ; for g in groups { let g = g . borrow ( ) ; let mut record = csv :: StringRecord :: new ( ) ; record . push_field ( g . file_len . 0 . to_string ( ) . as_str ( ) ) ; record . push_field ( g . file_hash . to_string ( ) . as_str ( ) ) ; record . push_field ( g . files . len ( ) . to_string ( ) . as_str ( ) ) ; for f in g . files . iter ( ) { record . push_field ( format ! ( " " f ) . as_ref ( ) ) ; } wtr . write_record ( & record ) ? ; } wtr . flush ( ) }
Writes results in CSV format.
Writes results in CSV format .
&mut self
_header
&ReportHeader
groups
I
&mut self
_header
&ReportHeader
groups
I