Commit 09bb644
Replace Vec-compatible wrappers with clean collection accessor methods
- Remove complex CompressedKeyView/ValueView wrapper types (3 structs + implementations)
- Add direct collection accessor methods that hide internal structure:
Key accessors:
- get_key(index), first_key(), last_key()
- keys_iter(), collect_keys()
Value accessors:
- get_value(index), get_value_mut(index)
- first_value(), last_value(), first_value_mut(), last_value_mut()
- values_iter(), values_iter_mut(), collect_values()
Pair accessors:
- get_pair(index), get_pair_mut(index)
- first_pair(), last_pair(), first_pair_mut(), last_pair_mut()
- collect_pairs()
- Add custom ValuesMutIter for safe mutable iteration over values
- Use raw pointers to solve borrowing conflicts in pair_mut methods
- Add comprehensive tests (55 total tests, all passing)
- Add demonstration of external code usage patterns
- Maintain clean encapsulation - no internal structure exposure
- Provide compatibility methods (collect_*) for existing code migration
Benefits:
- Cleaner API: No complex wrapper types to understand
- Better encapsulation: Internal structure completely hidden
- Flexible: Easy to add new accessors without breaking changes
- Efficient: Direct access without wrapper overhead
- Familiar: Similar to standard Rust collection APIs
Co-authored-by: Ona <no-reply@ona.com>1 parent f08c155 commit 09bb644
2 files changed
+628
-229
lines changed
0 commit comments