Crate tagger[][src]

This crate provides primitives to build up a html/xml/svg document programatically. Instead of using a templating engine, write data/markup that 'looks like' rust.

Why so many closures?

Unlike Drop, passing closures can be used to force the user to handle errors when something goes out of scope. If we put the writing of end tags in a Drop method it could silently fail, which is not ideal.

Modules

prelude

The prelude to import the element manipulation convenience macros.

svg

svg related building blocks

tag_types

Common tags to be used in Element::single_ext

Macros

wr

Convenience macro to reduce code. Create a closure that will use write!() with the formatting arguments.

Structs

AttributeWriter

Builder to write out attributes to an element.

Element

An element.

ElementHeaderWriter

Used by Element::elem

HeaderWrittenCertificate

Struct indicating that the ElementHeaderWriter::write function was called.

WriterAdaptor

Used by upgrade

Traits

WriteAttr

Functions the user can call to add attributes. AttributeWriter could have implemented these, but lets use a trait to simplify lifetimes.

Functions

upgrade

Upgrade a std::io::Write to be a std::fmt::Write