Trait ToCSV

Source
pub trait ToCSV {
    // Required methods
    fn csv_headers(&self) -> Vec<CSVField>;
    fn to_csv_record(&self) -> Vec<CSVField>;
}
Expand description

Describes how to save a list of this value as a CSV file.

It is done via two methods:

  1. self.csv_headers() gives the first row of the file, as a list of CSVField. For example, it can be time, score.
  2. self.to_csv_record() serializes the value as a CSV row. For example, it can be 16:07:32, 34.0.

Note that each call to self.to_csv_record() must return a list of CSVField where the field at index i corresponds to the header at index i given by self.csv_headers(). Otherwise, the CSV file will be invalid.

Required Methods§

Source

fn csv_headers(&self) -> Vec<CSVField>

The headers of the CSV file

Source

fn to_csv_record(&self) -> Vec<CSVField>

Serializes self as a list of CSVField. Each element in the vector must correspond to a header given by self.csv_headers()

Implementations on Foreign Types§

Source§

impl ToCSV for Box<dyn Stats>

Source§

impl ToCSV for FuzzerStats

Implementors§