Crate format_xml

Source
Expand description

Fast, minimal, feature-rich, xml-like formatting syntax for Rust!

We say xml-like because due to limitations and flexibility some concessions had to be made.

Features include:

  • Arbitrary expressions inside the formatting braces
  • Generates optimized Rust code at compiletime
  • Auto-escaping control characters.
  • Supports rust-analyzer auto complete, refactoring and more!
  • Supports Rust’s standard formatting specifiers
  • Control flow allows conditional and repeated formatting
  • Capture variables by value or by reference
  • Escape hatch to inject custom formatting code

See xfmt! for more information.

Macros§

eprint
Replaces eprint! using xfmt syntax.
eprintln
Replaces eprintln! using xfmt syntax.
fmt
Extended formatting syntax.
format
Replaces format! using xfmt syntax.
format_args
Replaces format_args! using xfmt syntax.
join
Joins the arguments in a displayable object.
panic
Replaces panic! using xfmt syntax.
print
Replaces print! using xfmt syntax.
println
Replaces println! using xfmt syntax.
write
Replaces write! using xfmt syntax.
writeln
Replaces writeln! using xfmt syntax.
xfmt
Xml-like formatting syntax.

Structs§

EscapeAttrValue
Escapes <, &, >, ', " when it appears in the formatted string.
EscapeText
Escapes <, &, > when it appears in the formatted string.

Functions§

fmt
Returns a displayable object using the closure argument as its implementation.
join
Displays an iterable with given separator between each item.