struct Template
pub struct Template {
pub src string
}Purpose
Structure encapsulating src.
Public fields
srcstring- source
#html/templateTemplates with escaped interpolation. No JS/CSS/URL context switch.
struct Templatepub struct Template {
pub src string
}Structure encapsulating src.
src stringstruct Dictpub struct Dict {
pub keys []string
pub vals []string
}Structure encapsulating keys, vals.
keys []stringvals []stringnewpub fn new(src string) TemplateConstruct a new value of this type.
src stringTemplate — a value of this type
new_dictpub fn new_dict() DictConstruct dict.
No arguments are required.
Dict — a value of this type
($&Dict) setpub fn (d $&Dict) set(k string, v string)Execute set on $&Dict.
d $&DictDict instance used by this call (exclusive borrow).k stringv stringThis call does not return a value.
getpub fn get(d &Dict, k string) stringExecute get.
d &Dictk stringstring — result string
execute_str_errpub fn execute_str_err(t &Template, root string) stringExecute str err. Throws on failure; handle the error or propagate it to the caller.
t &Templateroot stringstring — result string
execute_errpub fn execute_err(t &Template, d &Dict) stringExecute err. Throws on failure; handle the error or propagate it to the caller.
t &Templated &Dictstring — result string
execute_list_errpub fn execute_list_err(t &Template, items []string) stringExecute list err. Throws on failure; handle the error or propagate it to the caller.
t &Templateitems []stringstring — result string
execute_strpub fn execute_str(t &Template, root string) stringApply data to template and render output as string.
t &Templateroot stringstring — result string
executepub fn execute(t &Template, d &Dict) stringApply data context to template and execute rendering.
t &Templated &Dictstring — result string
execute_listpub fn execute_list(t &Template, items []string) stringRender the template with a list of strings as its data context; return one string.
t &Templateitems []stringstring — result string