rshtml_core 0.1.0

RsHtml: A Template Engine for Seamless HTML and Rust Integration.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::Node;
use crate::compiler::Compiler;
use anyhow::Result;
use proc_macro2::TokenStream;
use quote::quote;
use std::path::Path;

pub struct UseDirectiveCompiler;

impl UseDirectiveCompiler {
    pub fn compile(compiler: &mut Compiler, name: &String, path: &Path, component: &Node) -> Result<TokenStream> {
        compiler.use_directives.push((name.to_string(), path.to_path_buf()));
        compiler.components.insert(name.to_string(), (*component).clone());

        Ok(quote! {})
    }
}