CharterAgreementProtocol.Timestamp (Charter Agreement Protocol v0.2.1)

Copy Markdown View Source

CAP never authorizes.

Pure RFC 3339 UTC timestamp parsing and comparison.

Parsing never reads a clock. The protocol narrows RFC 3339 to uppercase T and a Z offset while retaining fractional seconds and leap-second syntax. ordering_ticks is an internal total-order coordinate that preserves the leap-second slot; it is not an elapsed-seconds value.

Summary

Functions

Compare two parsed instants.

Parse one exact UTC RFC 3339 instant.

Types

t()

@type t() :: %CharterAgreementProtocol.Timestamp{
  fraction: binary(),
  ordering_ticks: non_neg_integer()
}

Functions

compare(left, right)

@spec compare(t(), t()) :: :lt | :eq | :gt

Compare two parsed instants.

parse(value)

@spec parse(term()) :: {:ok, t()} | {:error, CharterAgreementProtocol.Error.t()}

Parse one exact UTC RFC 3339 instant.