# Hust Hust is an HTML-first way to embed Rust in HTML. ## This Crate This crate is for using hust in your projects. ## Usage Use a .hust file like so: ``` let result = include_hust!("test.hust"); ``` Imagine your file looks like: ```

Hello, World!

Hello from Hust!

<%= variable_name %> ``` The file will be converted to rust code that looks like the below, which will be inserted in place where the macro is run. ``` let output_buffer = String::new(); output_buffer.push_str("

Hello, World!

\n\r

Hello from Hust!

\n\r"); output_buffer.push_str(variable_name); output_buffer ``` This code is then inlined right where you called the macro. ## Example Hust ```

User

<%= &user.username %>
``` Or for more complex usage: ```

All Users

<%= &users.len().to_string() %> users found.
<% for user in users { %>
<%= &user.username %>
<% } %> New User ``` ## Downsides / Drawbacks Currently, it is impossible to debug. Due to the way macros work in Rust currently, any errors in your Hust code will be shown at `include_hust!` and not on the line of the file that actually caused the error. We are thinking of ways to improve this in the future.