ChunkedVec
Note: This is a learning project implementing a vector-like data structure with chunked storage.
ChunkedVec is a vector-like data structure that stores elements in fixed-size chunks. It provides a Vec-like interface while offering unique advantages in memory management and memory locality.
Features
- Flexible chunk-based storage with compile-time or runtime configurable chunk size
- Standard vector-like interface with efficient operations
- Support for both fixed-size and default-size chunk construction
- O(1) random access time complexity
- Efficient memory allocation during growth
- Support for constructing from various types (Vec, Array, Slice, Iterator)
Usage Examples
Basic Usage with Default Chunk Size
use ChunkedVec;
Using Fixed Chunk Size
use ChunkedVecSized;
Converting from Other Collections
use ChunkedVec;
Current Implementation Status
Implemented Features
- Comprehensive constructors (
new,with_capacity,with_chunk_count) - Push operation (supports all types)
- Index-based access (
get,get_mut,Index/IndexMuttraits) - Length and capacity queries (
len,capacity,allocated_capacity) - Fixed-size chunk support via
ChunkedVecSized - From/FromIterator implementations for various types
- Safe and unsafe getter methods
- Efficient memory management
Planned Features
- Advanced chunk-level operations
- Custom allocator support
- More collection traits implementation
- Performance optimizations for specific use cases
Contributing
This is an open learning project. Contributions and suggestions are welcome! Feel free to:
- Report bugs and suggest features
- Submit pull requests
- Share your use cases and feedback
- Help improve documentation