README

caijiewei295/tzif-engine/types does not have a README file

#
TzifResult

type TzifResult[T] = Result[T, TzifError]

#
AmbiguityStrategy

pub(all) enum AmbiguityStrategy {
PreferEarlier
PreferLater
}

#
ClockChange

pub(all) enum ClockChange {
NoClockChange
ClockForward
ClockBackward
}

How an explicit transition changes wall-clock time.

#
LeapSecond

pub(all) struct LeapSecond {
transition_time : Int64
correction : Int
}

A leap-second correction record retained from the second TZif data block.

transition_time is expressed in UNIX leap-time seconds and correction is the total correction after that instant, as defined by RFC 9636. Civil-time conversion deliberately continues to use POSIX seconds, but callers can inspect the original metadata instead of silently losing it.

#
LocalDateTime

pub(all) struct LocalDateTime {
year : Int
month : Int
day : Int
hour : Int
minute : Int
second : Int
utoff : Int
is_dst : Bool
abbr : String
}

#
LocalTimeResolution

pub(all) enum LocalTimeResolution {
Unique(Int64)
Ambiguous(Array[Int64])
Gap
}

Complete result of resolving a local civil time against a timezone.

Ambiguous keeps every matching POSIX instant in ascending order. In ordinary DST fall-backs there are two candidates, but retaining an array avoids making an undocumented two-candidate assumption for unusual historical transition data.

#
OffsetDateTime

pub(all) struct OffsetDateTime {
local_time : LocalDateTime
utc_time : Int64
offset : Int
}

A strict ISO-8601 date-time carrying a numeric UTC offset.

The local_time metadata contains exactly the parsed numeric offset; utc_time is the equivalent POSIX timestamp. It intentionally does not assert that a named timezone would use that offset at that instant.

#
OffsetInfo

pub(all) struct OffsetInfo {
utoff : Int
is_dst : Bool
abbr : String
source : OffsetSource
}

Offset and abbreviation effective at a UTC instant, without allocating a decomposed calendar value.

#
OffsetSource

pub(all) enum OffsetSource {
InitialType
ExplicitTransition(Int)
PosixFooter
}

Where the active offset at a UTC instant came from.

#
PosixDateRule

pub(all) enum PosixDateRule {
JulianNoLeap(Int)
DayOfYear(Int)
MonthWeekDay(Int, Int, Int)
}

#
PosixTimeBasis

pub(all) enum PosixTimeBasis {
Wall
Standard
Utc
}

#
PosixTransitionRule

pub(all) struct PosixTransitionRule {
date_rule : PosixDateRule
time_of_day : Int
time_basis : PosixTimeBasis
}

#
PosixTzRule

pub(all) struct PosixTzRule {
std_abbr : String
std_offset : Int
dst_abbr : String?
dst_offset : Int?
start_rule : PosixTransitionRule?
end_rule : PosixTransitionRule?
}

#
PostTransitionBehavior

pub(all) enum PostTransitionBehavior {
PosixFooter
LastExplicitType
}

The behavior used beyond the final explicit TZif transition.

#
TimeType

pub(all) struct TimeType {
utoff : Int
is_dst : Bool
abbr : String
}

#
Transition

pub(all) struct Transition {
utc_time : Int64
type_index : Int
}

#
TransitionDetail

pub(all) struct TransitionDetail {
index : Int
utc_time : Int64
before : TimeType
after : TimeType
offset_change : Int
clock_change : ClockChange
local_before : Int64
local_after : Int64
}

Fully interpreted form of an explicit TZif transition.

local_before and local_after are POSIX seconds on the local civil timeline immediately at the transition boundary, calculated respectively using the type before and after the transition.

#
TzifData

pub(all) struct TzifData {
version : Byte
time_types : Array[TimeType]
transitions : Array[Transition]
leap_seconds : Array[LeapSecond]
standard_indicators : Array[Bool]?
utc_indicators : Array[Bool]?
posix_rule : PosixTzRule?
}

#
TzifDiagnostics

pub(all) struct TzifDiagnostics {
version : Byte
transition_count : Int
time_type_count : Int
leap_second_count : Int
standard_indicator_count : Int
utc_indicator_count : Int
first_transition : Int64?
last_transition : Int64?
has_posix_footer : Bool
post_transition_behavior : PostTransitionBehavior
}

Summary information for inspection tools and operational diagnostics.

first_transition and last_transition describe only the explicit TZif transition table. A POSIX footer can extend behavior past last_transition.

#
TzifError

pub(all) enum TzifError {
InvalidMagic(String)
UnsupportedVersion(Byte)
TruncatedData
ResourceLimitExceeded(String)
InvalidTransitionTable(String)
TimestampOutOfRange(Int64)
InvalidLocalTime(LocalDateTime)
AmbiguousLocalTime(LocalDateTime, LocalDateTime)
PosixParseError(String)
InvalidIso8601(String)
}

Source Files