Skip to main content

Module format

Module format 

Source
Expand description

Human-oriented output formatters — the CLI’s thin presentation layer. Anything that emits canonical on-disk or wire bytes belongs in mkit-core (serialize.rs, pack.rs, etc.), not here.

Functions§

full_identity
Full-detail rendering of an mkit_core::Identity suitable for machine-readable output (e.g. JSONL from mkit log --format=json).
hex_hash
Render a Hash as 64 lowercase hex chars. Wrapper over mkit_core’s byte-level API that keeps a stable name at this layer.
human_date_utc
Render a Unix timestamp (seconds since the epoch, UTC) as a stable, human-readable string: YYYY-MM-DD HH:MM:SS +0000.
json_escape
Escape a Rust string for inclusion in a JSON string literal. Sufficient for the small, known fields emitted by --format=json callers (commit messages, hashes, identity strings). Does NOT handle surrogate pairs — UTF-8 round-trips as itself since JSON strings are UTF-8.
short_hash
Render the first n hex chars of a hash (min 4, max 64).
short_identity
Render a short mkit_core::Identity: for 8-byte opaque keys we show the LE u64 decimal; otherwise <kind>:<8-hex>.