Expand description
This library defines two string helper classes.
CowStr
Is a String that can be initialized to a static string or be build dynamically. Its contents can then be immutably shared. When mutation is required the string will be copied first.
SubStr
Refers to a (immutable) span inside a CowStr. Since SubStr are always immutable they store
the referred span directly which makes dereferencing them faster than CowStr.
Features
- singlethreaded uses
std::rc::Rcfor sharing strings. Default isstd::sync::Arc.
Structs
Tried to use a range larger than the string it should cover.
Arbitrary immutable text as span from some shared string
Enums
A shared string that can be either static or dynamic with copy-on-write semantic.