symbol_interner

Crates.iosymbol_interner
lib.rssymbol_interner
version0.1.2
sourcesrc
created_at2021-11-17 20:53:45.128151
updated_at2021-11-17 21:02:45.984755
descriptionA simple string interner / symbol table for Rust projects.
homepage
repository
max_upload_size
id483610
size5,587
Ryan Chandler (ryangjchandler)

documentation

README

Symbol Interner

A small Rust crate that provides a naïve string interner. Consult the [documentation] to learn about the types that are exposed.

Installation

Add the following to your Cargo.toml file:

[dependencies]
symbol_interner = "0.1"

Usage

You can create a new interner and store symbols using the Interner::new() and Interner.intern() methods.

use symbol_interner::prelude::*;

let mut interner = Interner::default();
let mut offset: Result<usize, InternerError> = interner.intern(String::from("Ryan"));

assert_eq!(offset.unwrap(), 0);
Commit count: 0

cargo fmt