Skip to main content

Module env

Module env 

Source
Expand description

Ambient state: where files live, and what day it is.

Env::capture is the only place the library reads process environment variables or the current directory, and Clock is the only source of the current date. Both are passed down explicitly so the rest of the crate is deterministic under test.

Structs§

Env
Where the tool reads and writes, and where it was invoked from.
FixedClock
A clock frozen at a fixed date, for tests and reproducible runs.
SystemClock
A clock backed by the system’s local time.

Enums§

EnvError
Errors produced while inspecting the environment.

Constants§

CONFIG_DIR_VAR
Environment variable holding an explicit configuration directory.
CONFIG_FILE_NAME
The name of the configuration file inside the configuration directory.
SESSION_VAR
Environment variable holding the Advent of Code session cookie.

Traits§

Clock
The source of the current date.

Functions§

is_december
Whether a date falls inside an Advent of Code event.