Crates.io | easy_node |
lib.rs | easy_node |
version | 0.3.2 |
source | src |
created_at | 2024-02-11 14:47:57.587438 |
updated_at | 2024-11-30 03:51:23.521367 |
description | Smart pointer for graph nodes. |
homepage | |
repository | https://github.com/nossie531/easy_node |
max_upload_size | |
id | 1135873 |
size | 32,794 |
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.
Nr
- like Rc
Nw
- like Weak
.These smart pointers behavior is similar to Rc
and Weak
.
However, These smart pointer comparison is location based.
by_address
is a great crate with similar purpose.
It supports location based comparison too. But unlike this crate,
it can target any type that implements Deref
trait. And therefore,
Weak
that does not implement Deref
need other support.
On the other hand, this crate specializes on Rc
and Weak
. Instead,
we discard other smart pointers like Box
. This is because this crate
assumes only nodes in graph or network.
As of 2024, to support unsize conversions with smart pointers, unstable
feature CoerceUnsized
is required. So, Rc<Type>
to Rc<dyn Trait>
conversion is supported, but Nr<Type>
to Nr<dyn Trait>
is not.
As workaround, we provide inter-conversions between Nr
and Rc
, and
between Nw
and Weak
. Nr
and Nw
functions as_base
, from_base
,
and base
are them.
v0.3.2
v0.3.1
prelude
module.v0.3.0
upgrade_ref
method (unsafe misusing...).NrCell
and NwCell
(not essential...).base
, as_base
, from_base
method.