Skip to content

internity v0.1.0

Latest

Choose a tag to compare

@github-actions github-actions released this 30 Jul 02:39
0de29c6

Initial release.

Added

  • LocalLexicon — a fast, single-threaded string interner (&mut self interning,
    live &self resolution).
  • ThreadedLexicon — a concurrent string interner: &self interning from many
    threads, a cheap Clone Arc-backed handle, fill-then-freeze.
  • Sym — a 4-byte, Copy, niche-optimized handle; as_u32/from_u32 and
    From<Sym> for u32 conversions; iter() over (Sym, &str).
  • Reader — a sealed trait for the frozen, Send + Sync, lock-free read form,
    produced by LocalLexicon::freeze / ThreadedLexicon::freeze; supports iter().
  • SymMap / SymSet / SymBuildHasher — fast Sym-keyed maps and sets via an
    identity-style hasher.
  • Extend and FromIterator for both interners.
  • Generic over the BuildHasher, defaulting to a fast non-cryptographic hasher.
  • no_std support: the crate is no_std + alloc without the default std
    feature (which enables ThreadedLexicon).
  • Optional serde feature: a string-based, interner-aware serialization model.
    #[derive(SerializeIn)] / #[derive(DeserializeIn)] resolve each Sym
    against a Reader / interner so values round-trip as their strings
    (serialize a Sym to its string, deserialize a string back into a Sym),
    making corpora portable across processes. SerializeReader snapshots a whole
    frozen corpus. Sym itself has no plain Serialize/Deserialize (a raw
    handle is meaningless outside its lexicon), and the live ThreadedLexicon is
    deserialize-only — serialize the frozen Reader instead.