pub struct MacroRegistry { /* private fields */ }Expand description
Macro implementation registry for dynamic dispatch
Allows for runtime selection of macro implementations based on macro name or other criteria.
Implementations§
Source§impl MacroRegistry
impl MacroRegistry
Sourcepub fn register(
&mut self,
name: &str,
implementation: fn(TokenStream) -> TokenStream,
)
pub fn register( &mut self, name: &str, implementation: fn(TokenStream) -> TokenStream, )
Register a new macro implementation
§Arguments
name- Name of the macroimplementation- Function implementing the macro logic
Sourcepub fn execute(&self, name: &str, input: TokenStream) -> TokenStream
pub fn execute(&self, name: &str, input: TokenStream) -> TokenStream
Sourcepub fn list_macros(&self) -> Vec<String>
pub fn list_macros(&self) -> Vec<String>
List all registered macro names
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MacroRegistry
impl RefUnwindSafe for MacroRegistry
impl Send for MacroRegistry
impl Sync for MacroRegistry
impl Unpin for MacroRegistry
impl UnwindSafe for MacroRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more