Skip to main content

Crate rfc3339_fast

Crate rfc3339_fast 

Source
Expand description

§RFC3339 Timestamp Library

A high-performance library for parsing and formatting RFC3339/ISO8601 timestamps, with support for nanosecond precision.

§Overview

This library provides efficient serialization and deserialization of RFC3339/ISO8601 timestamps in the format YYYY-MM-DDTHH:mm:ss[.nnn]Z. It supports:

  • Timestamps from year 1 to year 9999
  • Nanosecond precision (up to 9 decimal places)
  • Integration with std::time::SystemTime (with the default std feature)
  • no_std support by disabling default features
  • Optional support for chrono types via the chrono feature
  • Optional serde integration via the serde feature
  • SIMD acceleration on platforms supporting SSSE3 (x86/x86_64) or NEON (ARM)

§Examples

Parsing a timestamp from a string:

use std::str::FromStr;
let ts = Timestamp::from_str("2026-02-25T14:30:00Z").unwrap();

Formatting a timestamp to a string:

let ts = Timestamp::now();
let mut buf = Buffer::new();
let formatted = buf.format(ts);

Structs§

Buffer
A reusable buffer for formatting timestamps to strings.
Timestamp
A timestamp value that can be serialized to and deserialized from JSON.

Enums§

TimestampError
Error type for parsing or formatting JSON timestamps.