Skip to main content

Module truncation

Module truncation 

Source
Expand description

Grounded Output Truncation Module. Ports the “Middle-Truncation” patterns from Codex-RS to ensure Hematite preserves exit codes and headers while providing line metadata.

Structs§

TruncatedOutput

Functions§

formatted_truncate
safe_head
Returns the longest prefix of s that is at most max_bytes long and ends on a UTF-8 boundary.
safe_tail
Returns a suffix of s containing at most max_bytes bytes, starting on a UTF-8 boundary.
truncate_middle
Truncate a string by keeping the beginning and end, removing the middle. Ensures UTF-8 safety by finding valid character boundaries.