pub struct MacroTable { /* private fields */ }Expand description
The macros in scope.
Implementations§
Source§impl MacroTable
impl MacroTable
Sourcepub fn define(&mut self, name: &str, body: &str) -> Result<(), String>
pub fn define(&mut self, name: &str, body: &str) -> Result<(), String>
Define name as the object-like macro body, replacing any
previous definition.
§Errors
A replacement list §16.3.3/1 forbids, or one that does not tokenize, in one sentence.
Sourcepub fn define_function(
&mut self,
name: &str,
params: Vec<String>,
body: &str,
) -> Result<(), String>
pub fn define_function( &mut self, name: &str, params: Vec<String>, body: &str, ) -> Result<(), String>
Define name as a function-like macro.
§Errors
As Self::define, and a parameter list §16.3/4 forbids — a
name that is not an identifier, or one written twice — or a #
not followed by a parameter (§16.3.2/1).
Sourcepub fn is_defined(&self, name: &str) -> bool
pub fn is_defined(&self, name: &str) -> bool
Whether name is defined, whatever its body.
An include guard defines a name with an empty body, so emptiness is not absence.
Trait Implementations§
Source§impl Clone for MacroTable
impl Clone for MacroTable
Source§impl Debug for MacroTable
impl Debug for MacroTable
Auto Trait Implementations§
impl Freeze for MacroTable
impl RefUnwindSafe for MacroTable
impl Send for MacroTable
impl Sync for MacroTable
impl Unpin for MacroTable
impl UnsafeUnpin for MacroTable
impl UnwindSafe for MacroTable
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