[][src]Module zerogc::cell

Implements a GcCell to allow mutating values inside garbage collected objects.

Normally garbage collected objects are immutable, since their references are shared. It's typical for collectors to want to trigger a write barrier before writing to a field. All interior mutability requires triggering appropriate write barriers, which is unsafe.

The zerogc_derive crate can generate setters for fields that are wrapped in a GcCell. Just mark the field with #[zerogc(mutable(public))] and it'll generate a safe wrapper.

Structs

GcCell

A Cell pointing to a garbage collected object.