Skip to main content

modular_program

Attribute Macro modular_program 

Source
#[modular_program]
Expand description

Modules can either be a rust path to an instructions module, or it can be an object:

#[modular_program(modules=[
    mymod::instructions,
    {
        // Required, module path to instructions
        module: path::to::instructions,

        // Optional path, override where to look for the instructions
        file_path: "./src/mod/etc.rs",

        // Optional prefix, empty for no prefix
        prefix: "prefix",

        // Optional, A macro that wraps the call to the instruction, eg:
        // ```
        // macro_rules ix_wrapper {
        //     ($ix:path, $ctx:ident: $ctx_type:ty $(, $arg:ident: $arg_type:ty )*) => {
        //         $ix($ctx, $(, $arg)*)
        //     };
        // }
        // ```
        macro: path::to::macro
    }
])]
mod my_program {           
    use super::*;          
}