Skip to content

v2.3: Complete Standard Rust Traits 🦀

Choose a tag to compare

@github-actions github-actions released this 07 Oct 15:11

This release transforms StringTape into a fully-featured collection library with comprehensive standard trait implementations. All tape and view types now implement PartialEq, Eq, PartialOrd, Ord, and Hash, enabling their use in HashMap, HashSet, and sorted collections with lexicographic comparison semantics. The new DoubleEndedIterator implementations unlock reverse iteration, rfind(), and rposition() operations across all iterator types. Additional utility methods include contains() for membership testing, shrink_to_fit() for memory optimization, and first(), last(), pop() for Vec-like convenience. These additions maintain the library's zero-allocation guarantees and full no_std compatibility.

The memory layout documentation has been expanded to clearly distinguish between Tape and Cows architectures, with concrete performance trade-offs. Tape classes use Apache Arrow's cumulative offset layout for cache-friendly sequential access and zero-copy interop, while Cows classes employ packed (offset, length) entries with #[repr(C, packed(1))] to minimize memory footprint for large datasets—achieving 10x memory reduction compared to Vec<String>. The documentation now includes guidance on choosing between these approaches based on workload characteristics, particularly for high-throughput applications where unaligned access patterns may favor Tape classes despite their higher memory usage.