Skip to main content

Crate tokmd_types

Crate tokmd_types 

Source
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§

ContextFileRow
ContextReceipt
DiffReceipt
JSON receipt for diff output with envelope metadata.
DiffRow
A row in the diff output showing changes for a single language.
DiffTotals
Aggregate totals for the diff.
ExportArgs
ExportArgsMeta
ExportData
ExportReceipt
FileRow
LangArgs
LangArgsMeta
LangReceipt
LangReport
LangRow
ModuleArgs
ModuleArgsMeta
ModuleReceipt
ModuleReport
ModuleRow
RunReceipt
ScanArgs
ToolInfo
Totals
A small totals struct shared by summary outputs.

Enums§

ChildIncludeMode
ChildrenMode
ConfigMode
ExportFormat
FileKind
RedactMode
ScanStatus
TableFormat

Constants§

SCHEMA_VERSION
The current schema version for all receipt types.