fn fill_pdt_interval_pg(
    mut actual: &mut VecDeque<TimeStrToken>,
    time_unit: DateTimeField,
    mut pdt: &mut ParsedDateTime,
) -> Result<(), String> {
    use TimeStrToken::*;

    // We remove all spaces during tokenization, so TimeUnit only shows up if
    // there is no space between the number and the TimeUnit, e.g. `1y 2d 3h`, which
    // PostgreSQL allows.
    let mut expected = VecDeque::from(vec![
        Num(0, 1),
        Dot,
        Nanos(0),
        TimeUnit(DateTimeField::Year),
    ]);

    let sign = trim_and_return_sign(&mut actual);

    fill_pdt_from_tokens(&mut pdt, &mut actual, &mut expected, time_unit, sign)?;

    Ok(())
}
/// Fills a ParsedDateTime's fields for a single PostgreSQL-style interval
/// parts, e.g. `1 month`. Invoke this function once for each PostgreSQL-style
/// interval part.
///
/// Note that:
/// - This function only meaningfully parses the numerical component of the
///   string, and relies on determining the DateTimeField component from
///   AnnotatedIntervalPart, passed in as `time_unit`.
/// - Only PostgreSQL-style parts can use fractional components in positions
///   other than seconds, e.g. `1.5 months`.
Fills a ParsedDateTime's fields for a single PostgreSQL-style interval
parts, e.g.

Note that:
This function only meaningfully parses the numerical component of the
string, and relies on determining the DateTimeField component from
AnnotatedIntervalPart, passed in as `time_unit`.
Only PostgreSQL-style parts can use fractional components in positions
other than seconds, e.g.
Fills a ParsedDateTime ' s fields for a single PostgreSQL - style interval parts e . g . Note that : This function only meaningfully parses the numerical component of the string and relies on determining the DateTimeField component from AnnotatedIntervalPart passed in as ` time_unit ` . Only PostgreSQL - style parts can use fractional components in positions other than seconds e . g .
fn fill_pdt_interval_pg(
    mut actual: &mut VecDeque<TimeStrToken>,
    time_unit: DateTimeField,
    mut pdt: &mut ParsedDateTime,
) -> Result<(), String> {
    use TimeStrToken::*;
    // We remove all spaces during tokenization, so TimeUnit only shows up if
    // there is no space between the number and the TimeUnit, e.g. `1y 2d 3h`, which
    // PostgreSQL allows.
    let mut expected = VecDeque::from(vec![
        Num(0, 1),
        Dot,
        Nanos(0),
        TimeUnit(DateTimeField::Year),
    ]);
    let sign = trim_and_return_sign(&mut actual);
    fill_pdt_from_tokens(&mut pdt, &mut actual, &mut expected, time_unit, sign)?;
    Ok(())
}
fn fill_pdt_interval_pg ( mut actual : & mut VecDeque < TimeStrToken > , time_unit : DateTimeField , mut pdt : & mut ParsedDateTime , ) -> Result < ( ) , String > { use TimeStrToken :: * ; // We remove all spaces during tokenization, so TimeUnit only shows up if // there is no space between the number and the TimeUnit, e.g. `1y 2d 3h`, which // PostgreSQL allows. let mut expected = VecDeque :: from ( vec ! [ Num ( 0 1 ) Dot Nanos ( 0 ) TimeUnit ( DateTimeField Year ) ] ) ; let sign = trim_and_return_sign ( & mut actual ) ; fill_pdt_from_tokens ( & mut pdt , & mut actual , & mut expected , time_unit , sign ) ? ; Ok ( ( ) ) }
Fills a ParsedDateTime's fields for a single PostgreSQL-style interval
parts, e.g.
Fills a ParsedDateTime ' s fields for a single PostgreSQL - style interval parts e . g .
actual
&mut VecDeque<TimeStrToken>
time_unit
DateTimeField
pdt
&mut ParsedDateTime
actual
&mut VecDeque<TimeStrToken>
time_unit
DateTimeField
pdt
&mut ParsedDateTime