From 31864d3b216e164cbac3c359a20aa0ca7b43fdcb Mon Sep 17 00:00:00 2001 From: Mees Delzenne Date: Wed, 16 Aug 2023 15:49:35 +0200 Subject: [PATCH] Implement trace for `Class` --- core/src/class/trace.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/src/class/trace.rs b/core/src/class/trace.rs index a82aec5e..73626ee4 100644 --- a/core/src/class/trace.rs +++ b/core/src/class/trace.rs @@ -1,6 +1,8 @@ use std::marker::PhantomData; -use crate::{markers::Invariant, qjs, Ctx, Value}; +use crate::{markers::Invariant, qjs, Class, Ctx, Value}; + +use super::JsClass; /// A trait for classes for tracing references to quickjs objects. /// @@ -66,6 +68,15 @@ impl<'js> Trace<'js> for Ctx<'js> { } } +impl<'js, T> Trace<'js> for Class<'js, T> +where + T: JsClass<'js>, +{ + fn trace<'a>(&self, tracer: Tracer<'a, 'js>) { + self.0.trace(tracer) + } +} + macro_rules! trace_impls { (primitive: $( $(#[$meta:meta])* $($type:ident)::+$(<$lt:lifetime>)?,)*) => {