Skip to main content

vecdb/traits/
typed.rs

1use crate::{AnyVec, VecIndex, VecValue};
2
3/// A vector with statically-known index and value types.
4///
5/// This trait extends [`AnyVec`] by providing associated types for the index (`I`)
6/// and value (`T`) types, enabling type-safe operations at compile time.
7///
8/// # Type Parameters
9/// - `I`: The index type, must implement [`VecIndex`]
10/// - `T`: The value type, must implement [`VecValue`]
11pub trait TypedVec: AnyVec {
12    /// The index type used to address elements in this vector.
13    type I: VecIndex;
14    /// The value type stored in this vector.
15    type T: VecValue;
16}