pub struct CommandRegistry {
pub custom_macros: Vec<CustomMacro>,
pub custom_macro_names: HashMap<String, CommandType>,
}
Fields§
§custom_macros: Vec<CustomMacro>
§custom_macro_names: HashMap<String, CommandType>
Implementations§
Source§impl CommandRegistry
impl CommandRegistry
pub fn new() -> CommandRegistry
pub fn register_custom_macro( &mut self, name: &str, command_type: CommandType, implementation: Box<dyn Fn(&Vec<Vec<TexToken>>) -> Result<Vec<TexToken>, String>>, )
pub fn register_custom_macros(&mut self, custom_macros: Vec<CustomMacro>)
pub fn get_command_type(&self, command_name: &str) -> Option<CommandType>
pub fn expand_macros( &self, tokens: &[TexToken], ) -> Result<Vec<TexToken>, String>
Trait Implementations§
Source§impl Default for CommandRegistry
impl Default for CommandRegistry
Source§fn default() -> CommandRegistry
fn default() -> CommandRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CommandRegistry
impl !RefUnwindSafe for CommandRegistry
impl !Send for CommandRegistry
impl !Sync for CommandRegistry
impl Unpin for CommandRegistry
impl !UnwindSafe for CommandRegistry
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