What is the idiomatic way of embed files into Rust binary?

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • rust-embed

    Rust Macro which loads files into the rust binary at compile time during release and loads the file from the fs during dev.

    Maybe rust-embed can help you? I haven't used it myself, just came across the crate on this sub a while ago.

  • askama

    Type-safe, compiled Jinja-like templates for Rust

    askama template engine embeds templates into the binary.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

  • sailfish

    Simple, small, and extremely fast template engine for Rust

    If you're OK with a template engine that can't be used in any sort of "if debug builds, support hot reloading" mode, Sailfish compiles its templates to native code and it's the fastest option around.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts