Relative Content

Tag Archive for rustrust-macros

Generating evalexpr context dependent on need

For my use case, I want to match relatively huge structs dynamically against user-written rules. I figured the evalexpr crate would be the best shot at this, as I can convert my struct into a context and then, using the predefined names from my struct, let users write their own rules as arithmetic expressions.

How to handle dependent macros in Rust

I want to implement some file contents mutation functionality in Rust, but I am a bit lost on how to achieve this using procedural macros. I have an input file that is specified using an environment variable at build time. I want to get the content of this file and apply some mutations to it.

Rust Macro Function Indirection

I’m trying to right a macro for a formatting library of sorts. The idea is you can use a mix of string literals, regular functions and (this is where I get stuck) inferred/scoped functions. I suspect I could get this working with proc macros, but that’s more complicated and I’d like to keep the code for the macro easier to read if possible.