hawdb_executor/external/
vector_index.rs1use super::ExternalReadResourceContract;
5use hawdb_core::{Result, VectorRef};
6use hawdb_storage::NodeId;
7
8pub struct VectorIndexExecutionRequest<'a> {
9 pub index: &'a str,
10 pub embedding: VectorRef<'a>,
11 pub candidate_limit: usize,
12 pub top_k: usize,
13 pub resources: ExternalReadResourceContract<'a>,
14}
15
16#[derive(Debug, Clone, Copy)]
17pub struct VectorIndexExecutionRow {
18 pub node_id: NodeId,
19 pub distance: f64,
20}
21
22pub trait VectorIndexExecutionOutput {
25 fn row_count(&self) -> usize;
26 fn row(&self, ordinal: usize) -> Result<VectorIndexExecutionRow>;
27}