pub struct Interp<'a> {
pub steps: u64,
pub exhausted: bool,
/* private fields */
}Fields§
§steps: u64What is left of MAX_STEPS for the whole module.
exhausted: boolWhether the budget ran out, so the diagnostic is reported once rather than at every macro that would have run afterwards.
Implementations§
Source§impl<'a> Interp<'a>
impl<'a> Interp<'a>
pub fn new( defs: &'a HashMap<Arc<str>, FnDef>, diags: &'a mut Diagnostics, steps: u64, exhausted: bool, ) -> Interp<'a>
Sourcepub fn knowing(self, types: Option<&'a TypeEnv>) -> Interp<'a>
pub fn knowing(self, types: Option<&'a TypeEnv>) -> Interp<'a>
The same, with the checker’s answers about the call site in reach.
Sourcepub fn run_body(
&mut self,
name: &str,
body: &Node,
env: HashMap<Arc<str>, Val>,
def_span: Span,
) -> Option<Node>
pub fn run_body( &mut self, name: &str, body: &Node, env: HashMap<Arc<str>, Val>, def_span: Span, ) -> Option<Node>
Run a macro body, given its parameters already bound to the syntax they were called with.
The result is whatever the body returned, reflected into syntax — so return quote: … is
a template and return 6 * 7 is the literal 42.
Auto Trait Implementations§
impl<'a> Freeze for Interp<'a>
impl<'a> RefUnwindSafe for Interp<'a>
impl<'a> Send for Interp<'a>
impl<'a> Sync for Interp<'a>
impl<'a> Unpin for Interp<'a>
impl<'a> !UnwindSafe for Interp<'a>
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