Skip to main content

CommandMacro

Trait CommandMacro 

Source
pub trait CommandMacro: Send + Sync {
    // Required method
    fn transform(
        &self,
        command: Command,
        symbol_gen: &mut SymbolGen,
        type_info: &TypeInfo,
    ) -> Result<Vec<Command>, Error>;
}
Expand description

A command macro that can transform commands during desugaring

Required Methods§

Source

fn transform( &self, command: Command, symbol_gen: &mut SymbolGen, type_info: &TypeInfo, ) -> Result<Vec<Command>, Error>

Transform the command, potentially using type information. Returns the transformed commands. If the macro doesn’t apply, it should return vec![command] unchanged.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§