pub struct CompileConfig {Show 15 fields
pub input_paths: Vec<PathBuf>,
pub output_dir: PathBuf,
pub zones: ZoneSelection,
pub link_mode: LinkMode,
pub overwrite: bool,
pub unsupported_policy: UnsupportedPolicy,
pub transition_limit: usize,
pub emit_style: EmitStyle,
pub no_create_dirs: bool,
pub localtime: Option<String>,
pub localtime_name: Option<String>,
pub file_mode: Option<u32>,
pub redundant_until: Option<i64>,
pub range: Option<RangeSpec>,
pub leaps: Option<LeapTable>,
}Expand description
Fully-resolved configuration for a compile run.
Built by the CLI but usable directly from the library.
Fields§
§input_paths: Vec<PathBuf>Source files and/or directories to read tzdata from.
output_dir: PathBufRoot of the output tree. Required — there is no implicit system default.
zones: ZoneSelectionWhich zones to compile.
link_mode: LinkModeHow to write Links.
overwrite: boolOverwrite existing output files.
unsupported_policy: UnsupportedPolicyWhat to do when a zone uses unsupported syntax.
transition_limit: usizeHard cap on transitions emitted per zone (defence against pathological input).
emit_style: EmitStyleExplicit-transition emission style (T8-slim). EmitStyle::Default is behaviour-matched
and CORE.1-gated; zic-slim/zic-fat are opt-in structural-parity modes.
no_create_dirs: boolDo not create the --out tree (reference zic’s -D): if set, the output directory must
already exist. Default false — zic-rs creates the (explicit, never system-default) --out
root. The output-safety boundary is unchanged either way (T9.3).
localtime: Option<String>Optional localtime install-policy target (reference zic’s -l <zone>): after a successful
compile, create a localtime entry in the output tree linking the named (already-compiled)
zone. None (default) writes no such link. Opt-in install policy — it never affects the
canonical-zone behaviour sweep (CORE.1) and is materialised in phase 2 with the same
no-partial-install guarantee as every other output file (T9.4).
localtime_name: Option<String>Name of the localtime link within the output tree (reference zic’s -t, default
"localtime"). Constrained to a safe relative name under --out — unlike reference zic,
zic-rs will not write the link to an arbitrary/absolute/system path (e.g. /etc/localtime);
that is an intentional safer divergence (bucket 3). Ignored when Self::localtime is
None.
file_mode: Option<u32>Optional file permission bits (reference zic’s -m <mode>), as parsed octal (e.g. 644
→ 0o644). Applied to the created regular files (compiled TZif zones and copied link
files) after they are written; not applied to symlink entries (it would follow the link).
None (default) leaves the process umask in effect. Unix-only install metadata: a value on
a non-Unix platform is a config error caught before any write. Never affects the compiled
bytes or the canonical-zone behaviour sweep (T9.5). Note: zic-rs accepts the octal subset of
zic’s -m; symbolic chmod expressions (u+rwx) are not parsed.
redundant_until: Option<i64>Optional -R @hi redundant-tail bound (T10.3): under EmitStyle::ZicSlim, keep the
otherwise-droppable footer-governed explicit transitions out to this UT instant (inclusive),
for readers that ignore the POSIX footer. None (default) = pure slim. A no-op with the
fat-style default (everything is already kept). Independent of Self::emit_style’s slim/fat
choice — it only widens what slim keeps; it never changes behaviour (the kept transitions are
redundant with the footer) and never the TZif version.
range: Option<RangeSpec>Optional -r '[@lo][/@hi]' range-truncation bounds (T10.4). Parse-only for now — a value
is validated but not yet applied; the compile fails closed (rather than silently emitting
un-truncated output) until T10.4d lands the clamp + the -00 placeholder semantics.
leaps: Option<LeapTable>Optional parsed leap-second table (reference zic’s -L leapseconds) — the right/ build
profile (T11.6). When Some, the leap table is applied to every compiled zone via
compile::apply_leaps. None (default) is the ordinary/posix profile: no leap table, and
ordinary canonical-zone conformance is unchanged. Opt-in; never the default.
Trait Implementations§
Source§impl Clone for CompileConfig
impl Clone for CompileConfig
Source§fn clone(&self) -> CompileConfig
fn clone(&self) -> CompileConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more