Module vector_ref

Module vector_ref 

Source
Expand description

Zero-copy vector reference abstraction.

This module provides the VectorRef trait for zero-copy access to vectors, eliminating heap allocations during search operations.

§Performance

Using VectorRef instead of Vec<f32> eliminates:

  • Heap allocations: 0 allocations per read vs ~10k for 10k vector search
  • Memory copies: Direct slice access from mmap
  • Allocator pressure: No fragmentation from repeated alloc/dealloc

§EPIC-B: TS-MEM-001, TS-MEM-002

Structs§

BorrowedVector
A borrowed vector reference with explicit lifetime.
VectorGuard
Guard that holds a read lock and provides vector access.

Traits§

VectorRef
A reference to vector data that may be borrowed or owned.