pub struct CachedExpansion {
pub macro_id: u64,
pub ns: Arc<str>,
pub form: Arc<Form>,
}Expand description
One memoized macro expansion: valid while the call site resolves to the
same macro (macro_id) and is evaluated in the same namespace (ns).
Fields§
§macro_id: u64Identity of the macro function that produced form (its first arity’s
process-unique id). Redefining the macro mints a new id, so a stale
expansion is never reused.
ns: Arc<str>Namespace the call site was expanded in; ::kw and syntax-quote
resolution depend on it.
form: Arc<Form>The expansion. Held in an Arc so its own nested call sites keep a
stable address and therefore their own caches across evaluations.
Trait Implementations§
Auto Trait Implementations§
impl Forget for CachedExpansion
impl Freeze for CachedExpansion
impl Move for CachedExpansion
impl RefUnwindSafe for CachedExpansion
impl Send for CachedExpansion
impl Sync for CachedExpansion
impl Unpin for CachedExpansion
impl UnsafeUnpin for CachedExpansion
impl UnwindSafe for CachedExpansion
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