Module rc

Source
Expand description

Synchronized reference counting primitives.

This module introduces a family of reference counted types that allows marking the underlying data for destruction before all strongly references to the data are dropped. This enables the following features:

  • Upgrading a weak reference to a strong reference succeeds iff at least one strong reference exists and the data has not been marked for destruction.
  • Allow waiting for all strongly-held references to be dropped after marking the data.

Structs§

ArcNotifier
An implementation of Notifier that stores the unwrapped data in a Clone type.
DebugReferences
Provides a Debug implementation that contains information helpful for debugging dangling references.
DynDebugReferences
Like DebugReferences, but type-erases the contained type.
MapNotifier
An implementation of Notifier that wraps another Notifier and applies a function on notified objects.
Primary
A primary reference.
Strong
A strongly-held reference.
Weak
A weakly-held reference.

Traits§

Notifier
Provides delegated notification of all strong references of a Primary being dropped.