Struct dtparse::ParserInfo[][src]

pub struct ParserInfo {
    pub jump: HashMap<String, usize>,
    pub weekday: HashMap<String, usize>,
    pub months: HashMap<String, usize>,
    pub hms: HashMap<String, usize>,
    pub ampm: HashMap<String, usize>,
    pub utczone: HashMap<String, usize>,
    pub pertain: HashMap<String, usize>,
    pub tzoffset: HashMap<String, usize>,
    pub dayfirst: bool,
    pub yearfirst: bool,
    pub year: i32,
    pub century: i32,
}

Container for specific tokens to be recognized during parsing.

  • jump: Values that indicate the end of a token for parsing and can be ignored
  • weekday: Names of the days of the week
  • months: Names of the months
  • hms: Names for the units of time - hours, minutes, seconds in English
  • ampm: AM and PM tokens
  • utczone: Tokens indicating a UTC-timezone string
  • pertain: Tokens indicating a "belongs to" relationship; in English this is just "of"
  • tzoffset:
  • dayfirst: Upon encountering an ambiguous date, treat the first value as the day
  • yearfirst: Upon encountering an ambiguous date, treat the first value as the year
  • year: The current year
  • century: The first year in the current century

Please note that if both dayfirst and yearfirst are true, years take precedence and will be parsed as "YDM"

Fields

Tokens that can be safely ignored

Names of all seven weekdays

Names of all twelve months

Tokens to indicate a value is in units of hours, minutes, or seconds

Tokens to indicate a value refers to AM or PM time

Tokens to indicate our timestamp is in the UTC timezone

Tokens to indicate values "belonging" to other tokens (e.g. 3rd of March)

Map of timezone names to their offset in seconds

For ambiguous year/month/day values, and dayfirst was not specified as an argument to Parser, treat the first observed value as the day.

For ambiguous year/month/day values, and dayfirst was not specified as an argument to Parser, treat the first observed value as the day. Takes priority over dayfirst

The current year we are parsing values for

The current year we are parsing values for modulo 100

Trait Implementations

impl Debug for ParserInfo
[src]

Formats the value using the given formatter. Read more

impl PartialEq for ParserInfo
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Default for ParserInfo
[src]

Create a basic ParserInfo object suitable for parsing dates in English

Auto Trait Implementations

impl Send for ParserInfo

impl Sync for ParserInfo