macro_rules! impl_list_arc_safe {
    (impl$({$($generics:tt)*})? ListArcSafe<$num:tt> for $t:ty { untracked; } $($rest:tt)*) => { ... };
    (impl$({$($generics:tt)*})? ListArcSafe<$num:tt> for $t:ty {
        tracked_by $field:ident : $fty:ty;
    } $($rest:tt)*) => { ... };
    () => { ... };
}
Expand description

Declares that this type supports ListArc.

This macro supports a few different strategies for implementing the tracking inside the type:

  • The untracked strategy does not actually keep track of whether a ListArc exists. When using this strategy, the only way to create a ListArc is using a UniqueArc.
  • The tracked_by strategy defers the tracking to a field of the struct. The user much specify which field to defer the tracking to. The field must implement ListArcSafe. If the field implements TryNewListArc, then the type will also implement TryNewListArc.

The tracked_by strategy is usually used by deferring to a field of type AtomicTracker. However, it is also possible to defer the tracking to another struct using also using this macro.