|0.2.3||Jul 24, 2020|
|0.2.2||Jul 23, 2020|
|0.2.1||Jul 14, 2020|
|0.2.0||Jul 13, 2020|
|0.1.0||Jul 13, 2020|
#31 in Caching
A simple reference-counted interning library for strings, slices, and other data.
This crate provides two kinds of owned interners that store the interned
data in the reference-counted types
Arc<T>. When the
shrink_to_fit() method is called on the interner, or when the interner is
dropped, unused interned objects are deallocated.
The two kinds of interners provided by this crate are
Arc<T> objects respectively.
use std::rc::Rc; use refcount_interner::RcInterner; let mut interner = RcInterner::new(); let hello = interner.intern_str("hello"); let world = interner.intern_str("world"); assert!(Rc::ptr_eq(&hello, &interner.intern_str("hello")));
Documentation is provided via rustdoc, and can be built with
cargo doc, or
viewed online at
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.