pub enum ColSpec {
    Regex {
        source: String,
        colname: String,
        coldef: String,
        regex: Regex,
    },
    Mix {
        colname: String,
        coldef: String,
    },
}
Expand description

Types of specifications available to create a new column.

Variants

Regex

Fields

source: String
colname: String
coldef: String
regex: Regex

Creates a new column based on a previous column using a regular expression to extract information from it.

Mix

Fields

colname: String
coldef: String

Create a new column by mixing existing columns using a template

E.g. assuming that the month and day columns exist:

use csvsc::add::ColSpec;

let spec = ColSpec::Mix {
    colname: "new_col".to_string(),
    coldef: "{day}/{month}".to_string(),
};

Implementations

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.