Skip to main content

CompileConfig

Struct CompileConfig 

Source
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: PathBuf

Root of the output tree. Required — there is no implicit system default.

§zones: ZoneSelection

Which zones to compile.

§link_mode: LinkMode

How to write Links.

§overwrite: bool

Overwrite existing output files.

§unsupported_policy: UnsupportedPolicy

What to do when a zone uses unsupported syntax.

§transition_limit: usize

Hard cap on transitions emitted per zone (defence against pathological input).

§emit_style: EmitStyle

Explicit-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: bool

Do 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. 6440o644). 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

Source§

fn clone(&self) -> CompileConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CompileConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.