Added a new VString type that's a drop-in replacement for a regular String. VString on stack is just a regular String + an extra usize integer denoting current "version" of the string. It functions identically (via Deref and DerefMut traits) to a regular String, with main distinction being incrementing an internal counter on mutable access:
When used as a view a reference to a VString functions much like { ref some_regular_str } in that it performs no extra allocations and instead only diffs the pointer address + version of the string.
In practice it means that a &VString view should be used everywhere where a { ref string } cannot be used.
Added a new
VString
type that's a drop-in replacement for a regularString
.VString
on stack is just a regularString
+ an extrausize
integer denoting current "version" of the string. It functions identically (viaDeref
andDerefMut
traits) to a regularString
, with main distinction being incrementing an internal counter on mutable access:When used as a view a reference to a
VString
functions much like{ ref some_regular_str }
in that it performs no extra allocations and instead only diffs the pointer address + version of the string.In practice it means that a
&VString
view should be used everywhere where a{ ref string }
cannot be used.