Expand description
Composable, zero-allocation Display formatting combinators for Rust.
smart-format provides extension traits that add formatting operations to any type
implementing core::fmt::Display. Each operation returns a lightweight wrapper struct
that itself implements Display, so operations compose without intermediate allocations.
§Design
The core idea: a struct that wraps T: Display and implements Display with a
transformation is a zero-allocation combinator by construction. Chain them, and you
get a streaming pipeline that composes through core::fmt::Formatter without
intermediate String allocations.
Domain-specific transforms (HTML escaping, URL encoding, XML CDATA) are available behind feature flags so you only pay for what you use.
§Features
html— HTML escape, unescape, and attribute formattingurl— URL percent-encoding (addspercent-encodingdependency)xml— XML CDATA wrappingfull— enables all of the above