Timestamp#

pub struct Timestamp#

How timestamps are encoded in a file, plus which column holds them.

Use Timestamp::iso8601, Timestamp::epoch, Timestamp::custom, or Timestamp::relative to construct one.

Implementations#

impl Timestamp
pub fn iso8601(series_name: impl Into<String>) -> Self#

Timestamps are ISO 8601 strings.

pub fn epoch(series_name: impl Into<String>, unit: TimeUnit) -> Self#

Timestamps are numeric epochs in the given unit (e.g. epoch-seconds).

pub fn custom(series_name: impl Into<String>, format: impl Into<String>) -> Self#

Timestamps use a custom format string (Java DateTimeFormatter syntax).

pub fn relative(series_name: impl Into<String>, unit: TimeUnit) -> Self#

Timestamps are numeric offsets in the given unit relative to a start time. Use Self::with_offset to set the start time (required when ingesting into an existing dataset).

pub fn with_offset(self, offset: DateTime<Utc>) -> Self#

Set the starting offset for a relative timestamp.

pub fn with_default_year(self, year: i32) -> Self#

Set a default year for custom-format timestamps that lack year information (e.g. IRIG). No-op for other kinds.

pub fn with_default_day_of_year(self, day: i32) -> Self#

Set a default day-of-year for custom-format timestamps that lack date information. No-op for other kinds.

Trait implementations#

Derived: Debug, Clone

Auto traits: Send, Sync, Unpin, UnwindSafe, RefUnwindSafe