https://github.com/volight/pstr
Global String Intern Pool
https://github.com/volight/pstr
intern interned interning interning-string pool string string-pool
Last synced: 13 days ago
JSON representation
Global String Intern Pool
- Host: GitHub
- URL: https://github.com/volight/pstr
- Owner: volight
- License: mit
- Created: 2020-10-19T16:53:11.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-02T07:16:39.000Z (about 5 years ago)
- Last Synced: 2025-04-05T01:22:32.408Z (7 months ago)
- Topics: intern, interned, interning, interning-string, pool, string, string-pool
- Language: Rust
- Homepage: https://crates.io/crates/pstr
- Size: 84 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
***Global string intern pool***

[](https://crates.io/crates/pstr)
[](https://docs.rs/pstr)

Internal use of [DashMap](https://crates.io/crates/dashmap) for concurrent support
# Examples
- [`IStr`](https://docs.rs/pstr/0.7.0/pstr/struct.IStr.html)
```rust
use pstr::IStr;
let s = IStr::new("hello world");
```
- [`MowStr`](https://docs.rs/pstr/0.7.0/pstr/struct.MowStr.html)
```rust
use pstr::MowStr;
let mut s = MowStr::new("hello");
assert!(s.is_interned());
s.push_str(" ");
assert!(s.is_mutable());
s.mutdown().push_str("world");
assert_eq!(s, "hello world");
s.intern();
assert!(s.is_interned());
```