pub type BuildItem = (VectorId, Arc<[f32]>, Option<Metadata>);Expand description
One vector to feed into a build: its VectorId, its components owned as an
Arc<[f32]>, and its optional Metadata.
This is exactly the element type of
IndexCore::insert_batch, so building
never reshapes or re-copies your data: the Arc you hand in is the
allocation the index stores. Vectors without metadata pass None.
ยงExamples
use std::sync::Arc;
use iqdb_build::BuildItem;
use iqdb_types::VectorId;
let item: BuildItem = (VectorId::from(7u64), Arc::from([0.1_f32, 0.2].as_slice()), None);
assert_eq!(item.0, VectorId::from(7u64));
assert_eq!(item.1.len(), 2);