pub trait InlineMacroExprPlugin:
Debug
+ Sync
+ Send
+ Any {
// Required method
fn generate_code<'db>(
&self,
db: &'db dyn Database,
item_ast: &ExprInlineMacro<'db>,
metadata: &MacroPluginMetadata<'_>,
) -> InlinePluginResult<'db>;
// Provided methods
fn documentation(&self) -> Option<String> { ... }
fn plugin_type_id(&self) -> TypeId { ... }
}Required Methods§
Sourcefn generate_code<'db>(
&self,
db: &'db dyn Database,
item_ast: &ExprInlineMacro<'db>,
metadata: &MacroPluginMetadata<'_>,
) -> InlinePluginResult<'db>
fn generate_code<'db>( &self, db: &'db dyn Database, item_ast: &ExprInlineMacro<'db>, metadata: &MacroPluginMetadata<'_>, ) -> InlinePluginResult<'db>
Generates code for an item. If no code should be generated returns None. Otherwise, returns (virtual_module_name, module_content), and a virtual submodule with that name and content should be created.
Provided Methods§
Sourcefn documentation(&self) -> Option<String>
fn documentation(&self) -> Option<String>
Allows for the plugin to provide documentation for an inline macro.
Sourcefn plugin_type_id(&self) -> TypeId
fn plugin_type_id(&self) -> TypeId
A TypeId of the plugin, used to compare the concrete types
of plugins given as trait objects.