[][src]Enum csvsc::ColSpec

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

Types of specifications available to create a new column.

Variants

Regex

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

Fields of Regex

source: Stringcolname: Stringcoldef: Stringregex: Regex
Mix

Create a new column by mixing existing columns using a template

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

use csvsc::ColSpec;

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

Fields of Mix

colname: Stringcoldef: String

Implementations

impl ColSpec[src]

pub fn compute(
    &self,
    data: &Row,
    headers: &Headers
) -> Result<String, BuildError>
[src]

Trait Implementations

impl Debug for ColSpec[src]

Auto Trait Implementations

impl !RefUnwindSafe for ColSpec

impl Send for ColSpec

impl Sync for ColSpec

impl Unpin for ColSpec

impl UnwindSafe for ColSpec

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.