Module mozjs::gc

source ·



  • An RAII guard used to root underlying data in CustomAutoRooter until the guard is dropped (falls out of scope). The underlying data can be accessed through this guard via its Deref and DerefMut implementations. This structure is created by root method on CustomAutoRooter or by the auto_root! macro.
  • A vector of items to be rooted with RootedVec. Guaranteed to be empty when not rooted.
  • Rust API for keeping a Rooted value in the context’s root stack. Example usage: rooted!(in(cx) let x = UndefinedValue());. RootedGuard::new also works, but the macro is preferred.
  • Roots any JSTraceable thing
  • Holds a set of JSTraceables that need to be rooted
  • A vector of items rooted for the lifetime ’a.


  • Similarly to Traceable trait, it’s used to specify tracing of various types that are used in conjunction with CustomAutoRooter.
  • A trait for types which can place appropriate GC barriers.
  • A trait for JS types that can be registered as roots.
  • Types that can be traced.


Type Aliases