pub struct Html {
pub list: BTreeMap<i64, BTreeMap<i64, Arc<BTreeMap<i64, Vec<Node>>>>>,
}
Expand description
Html template marker
Values
list: BTreeMap<i64, BTreeMap<i64, Arc<BTreeMap<i64, Vec<Node>>>>>
- List of templates.
Fields§
§list: BTreeMap<i64, BTreeMap<i64, Arc<BTreeMap<i64, Vec<Node>>>>>
Implementations§
source§impl Html
impl Html
sourcepub async fn new(root: &str) -> Html
pub async fn new(root: &str) -> Html
Reads ./app/ and recognizes templates
Description
In the root directory of the project (Init::root_path
) the app
directory is searched.
Template files are logically located in this directory.
Each file must be named and have the extension .html
Example:
- index template: ./app/module_name/class_name/index.html
- not_found template: ./app/module_name/class_name/not_found.html
module_name - Name of the module
class_name - Class name
Use in the template:
To get a template, it is enough to set the this.render("template")
function
If no template is found, the asnwer will be None.
Used symbols
{% str %}
- Unescaped output.{%+ str %}
- Escaped output.{%# comment %}
- Comment.{%? bool %}
- If.{%?~%}
- Else.{%?%}
- End if.{%@ arr %}
- Loop vec.{%@%}
- End loop.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Html
impl Send for Html
impl Sync for Html
impl Unpin for Html
impl UnwindSafe for Html
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more