interning

Crates.iointerning
lib.rsinterning
version0.2.3
sourcesrc
created_at2024-02-04 12:29:04.234752
updated_at2024-02-05 12:40:27.157371
descriptionA Simple Thread-Lcoal and Global Interning Library
homepage
repositoryhttps://github.com/JakkuSakura/interning
max_upload_size
id1126331
size15,362
Jakku Sakura (JakkuSakura)

documentation

README

Interning

Interning is the process of storing only one copy of each distinct string value, which must be immutable. This process is used to save memory space and improve performance.

Usage

Add dependencies to your Cargo.toml:

[dependencies]
interning = "0.2"
use interning::InternedString;
fn main() {
    let s1 = InternedString::new("hello");
    let s2 = InternedString::new("hello");
    assert_eq!(s1, s2);
}

Change Log

  • 0.1.0
    • Initial release
  • 0.2.0
    • Inline small strings
  • 0.2.1
    • Add InternedStringHash for endianness-independent hashing and user-friendly API
Commit count: 0

cargo fmt