Skip to main content

Module text

Module text 

Source
Expand description

Allocation-free text formatting for render (SPEC-001 CORE-R49, GEN-R11).

format! allocates a String, which GEN-R11 forbids in render. StackText is a fixed-capacity buffer on the stack that implements core::fmt::Write, so write!(buf, "T/Tc {:.2}", t) formats a readout with no heap traffic.

Structs§

StackStr
A fixed-capacity UTF-8 string of at most N bytes that errors on overflow (CORE-R109): unlike StackText a write that does not fit returns fmt::Error and leaves the buffer unchanged, so a caller can fall back to a shorter form (voyager_journey’s readout fit ladder) instead of silently losing the tail.
StackText
A fixed-capacity UTF-8 string of at most N bytes, living inline (CORE-R49).