[][src]Crate weft

weft.

This module provides runtime support for weft templates.

Example:

   #[macro_use]
   extern crate weft_derive;
   extern crate weft;
   #[derive(WeftRenderable)]
   #[template(source = "<p>Hello {{ self.0 }}!</p>")]
   struct Greeting(String);

    fn main() {
        let s = weft::render_to_string(Greeting("world".into())).expect("render_to_string");
        println!("{}", s);
        // Should print `<p>Hello world!<p>`
    }

Structs

AttrPair

An attribute name and value pair.

QName

An internal representation of a qualified name, such as a tag or attribute. Does not currently support namespaces.

Traits

RenderTarget

Something that we can use to actually render HTML to text.

WeftRenderable

This is designed to be implemented via the weft_derive crate, but can be implemented manually for special cases.

Functions

render_to_string

Renders the template in widget to a new String.

render_writer

Renders the template in widget to the writer out.