contain-rs
A crate for defining/extending lifetimes.
Examples
Simple Container
A basic fast implementation of Container backed by Vec.
use ;
let container = new;
let a = append_thing;
let b = append_thing;
let c = append_thing;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!
Deduplicating Container
A deduplicating Container backed by a std::collections::HashSet.
If two equal items are stored, the second is dropped
and a reference to the first is returned.
Whilst more resource-intensive than SimpleContainer, it can be more memory efficient in scenarios where many
items are equal and equivalent since the duplicates will be dropped.
use ;
let container = new;
let a = append_thing;
let b = append_thing;
let c = append_thing;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;