Logo

0x3d.Site

is designed for aggregating information.
Welcome
check repository here

Rustache Build Status

Rustache is a Rust implementation of the Mustache spec.

Documentation

The different Mustache tags are documented at the mustache(5) man page.

The project's docs page is located here.

Install

Install it through Cargo:

rustache = "^0.1"

Then link it within your crate like so:

extern crate rustache;

API Methods

The main forward interface that users will interact with when using Rustache is the render method provided by the rustache::Render trait like so:

// Renders the given template string
let data = rustache::HashBuilder::new().insert("name", "your name");
let mut out = Cursor::new(Vec::new());
data.render("{{ name }}", &mut out).unwrap();
println!("{}", String::from_utf8(out.into_inner()).unwrap());

Examples

Here's an example of how to pass in data to the render_text method using the HashBuilder:

let data = HashBuilder::new()
    .insert("name", "Bob");
let mut out = Cursor::new(Vec::new());

data.render("{{ name }}", &mut out);

Here's an example of how to pass in data in the form of a JSON enum to a render method:

let data = json::from_str(r#"{"name": "Bob"}"#);
let mut out = Cursor::new(Vec::new());

data.render("{{ name }}", &mut out);

For more examples please see the tests directory.

Testing

Simply clone and run:

cargo test

Roadmap

  • Full Mustache spec compliance.

    • Comment and Section whitespace handling
    • Handle change of delimeters
  • Thread errors through the parser and compiler:

  • Real world project examples.

  • Handle Build and Parser operations concurrently

Contribute

See CONTRIBUTING.md for guidelines on how to contribute.

License

Copyright (c) 2014 Team Rustache

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Inspired by https://github.com/erickt/rust-mustache:

Copyright (c) 2012 Erick Tryzelaar

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Rust
Rust
Rust is a modern programming language focused on safety, speed, and concurrency. It prevents common bugs like null pointer dereferencing and data races, making it ideal for system programming and high-performance applications.
Create business apps like assembling blocks | ILLA Cloud
Create business apps like assembling blocks | ILLA Cloud
GitHub - 0x59616e/SteinsOS: An operating system written in Rust
GitHub - 0x59616e/SteinsOS: An operating system written in Rust
GitHub - j0ru/kickoff: Minimalistic program launcher
GitHub - j0ru/kickoff: Minimalistic program launcher
Workflow runs · rust-lang/rustup
Workflow runs · rust-lang/rustup
GitHub - paradigmxyz/artemis: A simple, modular, and fast framework for writing MEV bots in Rust.
GitHub - paradigmxyz/artemis: A simple, modular, and fast framework for writing MEV bots in Rust.
Workflow runs · sigp/lighthouse
Workflow runs · sigp/lighthouse
GitHub - flox/flox: Developer environments you can take with you
GitHub - flox/flox: Developer environments you can take with you
Unified Architecture - OPC Foundation
Unified Architecture - OPC Foundation
MaidSafe
MaidSafe
ttyperacer / terminal-typeracer · GitLab
ttyperacer / terminal-typeracer · GitLab
GitHub - cloudhead/rx: 👾 Modern and minimalist pixel editor
GitHub - cloudhead/rx: 👾 Modern and minimalist pixel editor
GitHub - rust-ethereum/ethabi: Encode and decode smart contract invocations
GitHub - rust-ethereum/ethabi: Encode and decode smart contract invocations
GitHub - watchexec/watchexec: Executes commands in response to file modifications
GitHub - watchexec/watchexec: Executes commands in response to file modifications
GitHub - osa1/tiny: A terminal IRC client
GitHub - osa1/tiny: A terminal IRC client
GitHub - sergree/whatbpm: 💓 Today's Trending Values for EDM Production
GitHub - sergree/whatbpm: 💓 Today's Trending Values for EDM Production
GitHub - rsaarelm/magog: A roguelike game in Rust
GitHub - rsaarelm/magog: A roguelike game in Rust
GitHub - autonomys/subspace: Subspace Network reference implementation
GitHub - autonomys/subspace: Subspace Network reference implementation
GitHub - nicohman/eidolon: Provides a single TUI-based registry for drm-free, wine and steam games on linux, accessed through a rofi launch menu.
GitHub - nicohman/eidolon: Provides a single TUI-based registry for drm-free, wine and steam games on linux, accessed through a rofi launch menu.
GitHub - shshemi/tabiew: A lightweight, terminal-based application to view and query delimiter separated value formatted documents, such as CSV or TSV files.
GitHub - shshemi/tabiew: A lightweight, terminal-based application to view and query delimiter separated value formatted documents, such as CSV or TSV files.
GitHub - joamag/boytacean: A GB emulator that is written in Rust 🦀!
GitHub - joamag/boytacean: A GB emulator that is written in Rust 🦀!
GitHub - chaosprint/glicol: Graph-oriented live coding language and music/audio DSP library written in Rust
GitHub - chaosprint/glicol: Graph-oriented live coding language and music/audio DSP library written in Rust
GitHub - wasmerio/winterjs: Winter is coming... ❄️
GitHub - wasmerio/winterjs: Winter is coming... ❄️
GitHub - withoutboats/notty: A new kind of terminal
GitHub - withoutboats/notty: A new kind of terminal
GitHub - cfal/shoes: A multi-protocol proxy server written in Rust (HTTP, HTTPS, SOCKS5, Vmess, Vless, Shadowsocks, Trojan, Snell)
GitHub - cfal/shoes: A multi-protocol proxy server written in Rust (HTTP, HTTPS, SOCKS5, Vmess, Vless, Shadowsocks, Trojan, Snell)
GitHub - eigerco/beerus: A stateless trustless Starknet light client in Rust 🦀
GitHub - eigerco/beerus: A stateless trustless Starknet light client in Rust 🦀
GitHub - quilt/etk: evm toolkit
GitHub - quilt/etk: evm toolkit
GitHub - pop-os/system76-power: System76 Power Management
GitHub - pop-os/system76-power: System76 Power Management
GitHub - Limeth/ethaddrgen: Custom Ethereum vanity address generator made in Rust
GitHub - Limeth/ethaddrgen: Custom Ethereum vanity address generator made in Rust
The Tor Project / Core / Arti · GitLab
The Tor Project / Core / Arti · GitLab
Production
Production
Rust
More on Rust

Programming Tips & Tricks

Code smarter, not harder—insider tips and tricks for developers.

Error Solutions

Turn frustration into progress—fix errors faster than ever.

Shortcuts

The art of speed—shortcuts to supercharge your workflow.
  1. Collections 😎
  2. Frequently Asked Question's 🤯

Tools

available to use.

Made with ❤️

to provide resources in various ares.