Expand description
§weft.
This module provides runtime support for weft templates.
§Example:
use weft_derive::WeftRenderable;
#[derive(WeftRenderable)]
#[template(source = "<p>Hello {{ self.0 }}!</p>")]
struct Greeting(String);
let s = weft::render_to_string(Greeting("world".into())).expect("render_to_string");
println!("{}", s);
// Should print `<p>Hello world!<p>`Modules§
- prelude
- A module for things that should be in-scope by default in a template expression.
Structs§
- Attr
Pair - 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§
- Render
Target - Something that we can use to actually render HTML to text.
- Weft
Renderable - This is designed to be implemented via the
weft_derivecrate, but can be implemented manually for special cases.
Functions§
- render_
to_ string - Renders the template in
widgetto a new String. - render_
writer - Renders the template in
widgetto the writerout.
Derive Macros§
- Weft
Renderable - Derives a
WeftRenderableinstance from a given html template.