Expand description
Streaming query APIs for memory-efficient result iteration
This module provides streaming interfaces for query results, allowing processing of large result sets without loading everything into memory.
§Features
- Iterator-based streaming
- Cursor-based pagination
- Backpressure support
- Memory-efficient for large result sets
§Usage
use vecstore::{VecStore, Query};
let store = VecStore::open("vectors.db")?;
let query = Query::new(vec![0.1, 0.2, 0.3]);
// Stream results instead of loading all at once
let mut stream = store.query_stream(query)?;
while let Some(result) = stream.next() {
println!("ID: {}, Score: {}", result.id, result.score);
// Process one result at a time - memory efficient!
}Structs§
- Batched
Stream - Batched streaming query
- Query
Cursor - Cursor for paginated queries
- Query
Stream - Streaming query result iterator