Crate easy_node

source ·
Expand description

Smart pointer for graph nodes.

The author of this crate is not good at English. Forgive me if the document is hard to read.

This crate provides some smart pointers optimized for managing graph data structures.

These smart pointers behavior is similar to Rc and Weak.
However, there are several important differences between them.

§Point1 - Comparison of smart pointers

This crate smart pointer comparison is based on location.
This allows smart pointers to be used as HashSet values, etc.

For example, comparison of Nr::eq is based on identity of node address.
On the other hand comparison of Rc::eq is based on inner value.

§Point2 - Upgrade from weak reference

This crate weak reference upgrade returns strong reference location.
This allows smart pointers act as dynamic object directly.

For example, Nw::upgrade returns Nr location.
On the other hand Weak::upgrade returns Rc itself.

Structs§

  • Strong node reference.
  • Strong node reference with dynamic borrow checker.
  • Weak node reference.
  • Weak node reference with dynamic borrow checker.