Function chrono::format::parse
[-] [+]
[src]
pub fn parse<'a, I>(parsed: &mut Parsed, s: &str, items: I) -> ParseResult<()> where I: Iterator<Item=Item<'a>>
Tries to parse given string into parsed
with given formatting items.
Returns Ok
when the entire string has been parsed (otherwise parsed
should not be used).
There should be no trailing string after parsing; use a stray Item::Space
to trim whitespaces.
This particular date and time parser is:
- Greedy. It will consume the longest possible prefix.
For example,
April
is always consumed entirely when the long month name is requested; it equally acceptsApr
, but prefers the longer prefix in this case. - Padding-agnostic (for numeric items). The
Pad
field is completely ignored, so one can prepend any number of whitespace then any number of zeroes before numbers. - (Still) obeying the intrinsic parsing width. This allows, for example, parsing
HHMMSS
.