Type Definition rad::MacroType[][src]

pub type MacroType = fn(_: &str, _: bool, _: &mut Processor) -> Result<String, RadError>;
Expand description

Type signature of basic macros

This is in order of args, greediness, processor’s mutable reference

Example

fn demo(args: &str, greedy: bool, processor: &mut Processor) -> Result<String, RadError> {
    let mut medium = String::new();
    // Some logics go here
    Ok(medium)
}

// ... While building a processor ...
processor.add_basic_rules(vec![("test", test as MacroType)]);