2 releases

0.1.1 Jun 22, 2023
0.1.0 Jun 22, 2023

#4 in #interner

MIT license

30KB
676 lines

Sto

Latest Version License CI Docs Build

Documentation: https://docs.rs/sto

MSRV: 1.65.0 (3 November, 2022)

License: MIT


lib.rs:

Sto

sto is a string interning crate, just like string-interner, lasso and ustr, but maintains lifetime-bounded, pointer-sized interned strings, and allocates memory only when needed.

  • [Repository], a thread-safe struct where strings are stored,
  • [ScopedSto], a handle to access the interned string,
  • [Sto], an alias of ScopedSto<'static>,
  • to intern a string, see ScopedSto::intern_in,
  • to get the interned string, see ScopedSto::as_str,
  • to check memory footprint, see Repository::allocated_memory,
  • to access the global Repository provided by feature global, see [repository()],
  • to intern a string in the global Repository, see Sto::from.

Features

Name Default Description
global provide a shared global Repository

Dependencies

~1–8MB
~24K SLoC