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.
- Fixed
Clock - A clock frozen at a fixed date, for tests and reproducible runs.
- System
Clock - 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.