[][src]Module clipivot::parsing

The module for customized parsing of types for the command-line program.

The two objects, CustomDateObject and DecimalWrapper are simple wrappers over existing data types -- chrono::NaiveDateTime in the case of CustomDateObject and rust_decimal::Decimal in the case of DecimalWrapper.

This is necessary because chrono doesn't use FromStr (because it doesn't know the format it needs to parse) and because I wanted to return the number of days between datetimes for range (overwriting std::ops::Sub). And decimal has a way of parsing values in scientific notation and parsing normal numbers. So I added the scientific notation parsing to the implementation of FromStr.

Structs

CustomDateObject

A light wrapper over chrono::NaiveDateTime. Also implements std::ops::Sub to compute the total number of days between two dates. This is probably not smart, but it allows me to easily run Range on dates.

DecimalWrapper

A light wrapper over rust_decimal::Decimal.

Statics

INPUT_DATE_FORMAT

The user-entered date format, used to allow CustomDateObject to run FromStr without needing an input string.

Functions

set_date_format

Sets INPUT_DATE_FORMAT.