Expand description
§tokmd-types
Tier 0 (Core Types)
This crate defines the core data structures and contracts for tokmd.
It contains only data types, Serde definitions, and schema_version.
§Stability Policy
JSON-first stability: The primary contract is the JSON schema, not Rust struct literals.
- JSON consumers: Stable. New fields have sensible defaults; removed/renamed fields
bump
SCHEMA_VERSION. - Rust library consumers: Semi-stable. New fields may be added in minor versions,
which can break struct literal construction. Use
Default+ field mutation or..Default::default()patterns for forward compatibility.
If you need strict Rust API stability, pin to an exact version.
§What belongs here
- Pure data structs (Receipts, Rows, Reports)
- Serialization/Deserialization logic
- Stability markers (SCHEMA_VERSION)
§What does NOT belong here
- File I/O
- CLI argument parsing
- Complex business logic
- Tokei dependencies
Structs§
- Context
File Row - Context
Receipt - Diff
Receipt - JSON receipt for diff output with envelope metadata.
- DiffRow
- A row in the diff output showing changes for a single language.
- Diff
Totals - Aggregate totals for the diff.
- Export
Args - Export
Args Meta - Export
Data - Export
Receipt - FileRow
- Lang
Args - Lang
Args Meta - Lang
Receipt - Lang
Report - LangRow
- Module
Args - Module
Args Meta - Module
Receipt - Module
Report - Module
Row - RunReceipt
- Scan
Args - Tool
Info - Totals
- A small totals struct shared by summary outputs.
Enums§
Constants§
- SCHEMA_
VERSION - The current schema version for all receipt types.