weak-table-rs: weak hash maps and sets for Rust
This crate defines several kinds of weak hash maps and sets. See the full API documentation.
Usage
It’s on crates.io, so you can add
[]
= "0.1.2"
to your Cargo.toml
and
extern crate weak_table;
to your crate root.
Examples
Here we create a weak hash set and demonstrate that it forgets elements whose reference counts expire:
use WeakHashSet;
use ;
type Table = ;
let mut set = new;
let a = from;
let b = from;
set.insert;
assert!;
assert!;
set.insert;
assert!;
assert!;
drop;
assert!;
assert!;