packages

toml::datetime

On this page

TOML date / time values (RFC 3339, with TOML's local forms).

Structs

DateSource

pub struct Date

A calendar date.

TimeSource

pub struct Time

A time of day. TOML keeps fractions to the nanosecond; more digits are truncated.

DatetimeSource

pub struct Datetime

One of TOML's four date-time forms, by which parts are present: offset date-time (all three), local date-time (date + time), local date (date), local time (time). offset is minutes east of UTC (Z is 0) and only comes with both date and time.

  • pub date: Date | none§

    Source
  • pub time: Time | none§

    Source
  • pub offset: i16 | none§

    Source
  • pub fn kind(self) -> str§

    Source

    The form's name, as toml-test spells it: datetime, datetime-local, date-local or time-local.

  • pub fn parse(s: str) -> Datetime | none§

    Source

    Read a TOML 1.1 date-time (1979-05-27T07:32:00Z, 1979-05-27 07:32:00, 1979-05-27, 07:32:00.999, 07:32).

Trait implementations 1
  • impl Display for Datetime

Functions

scanSource

pub fn scan(s: str, at: usize, v11: bool) -> (Datetime, usize) | none

A date-time at at of s: the value and the index after it, or none when the text there is not a valid date-time. v11 lets the seconds be left out.