pub struct Traces { /* private fields */ }Expand description
The interning table for expansion traces.
Implementations§
Source§impl Traces
impl Traces
Sourcepub fn push(&mut self, macro_name: Symbol, at: Span, outer: TraceId) -> TraceId
pub fn push(&mut self, macro_name: Symbol, at: Span, outer: TraceId) -> TraceId
Records that macro_name, invoked at at, was reached from outer.
The result is the trace the tokens it produces should carry. Expansion works outermost macro first, so the chain above a step is always already interned by the time the step is, and the list grows inwards.
Sourcepub fn chain(&self, id: TraceId) -> Vec<Step>
pub fn chain(&self, id: TraceId) -> Vec<Step>
The chain from the outermost macro inwards, which is the order a reader wants it.
The list points the other way, because a step can only be interned once the chain above it exists, so this walks it and reverses. Chains are a handful of steps long in the worst real case, so the allocation is not worth avoiding.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Traces
impl RefUnwindSafe for Traces
impl Send for Traces
impl Sync for Traces
impl Unpin for Traces
impl UnsafeUnpin for Traces
impl UnwindSafe for Traces
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