pub trait MacroGetter {
// Required method
fn get_macro(&self, name: &str) -> Result<Option<&Macro>>;
}
Expand description
Trait over different ways to get macros by name
The intent is to allow for different methods of storing macros without requiring loading them in at editor startup. For example reading macros from filepaths based on their names, or perhaps from environment variables.
A ready implementation exists for HashMap, if you prefer to load in at startup for infallible macro getting during execution. A very good option if if you embedd your macro declarations in your editor’s main config file.