Crate wobbly

source ·
Expand description

CI Status MSRV Latest Version Rust Doc Crate Rust Doc Main

wobbly provides the single-threaded rc::Wobbly<T> and thread-safe sync::Wobbly<T> reference-counting pointers that are similar to Weak but provide wobbly-shared ownership of a value of type T, allocated on the heap. Unlike Weak pointers, a group of Wobbly pointers shares one owning (strong) pointer that is released when the first Wobbly of the group is dropped, and Wobbly pointers can thus keep a value alive like std::rc::Rc or std::sync::Arc but can also break cycles by being a non-owning pointer like std::rc::Weak or std::sync::Weak.

See the rc and sync modules for more details.

Modules§

  • Single-threaded reference-counting pointers. ‘Rc’ stands for ‘Reference Counted’. This module provides extended functionality for std::rc.
  • Thread-safe reference-counting pointers. ‘Arc’ stands for ‘Atomically Reference Counted’. This module provides extended functionality for std::sync.