pub(crate) mod disk;
pub(crate) mod exhaustive;
pub(crate) mod filters;
pub(crate) mod graph_index;
pub(crate) mod multi_vector;
pub(crate) mod save_and_load;
#[cfg(feature = "bftree")]
pub(crate) mod bftree;
pub(crate) trait Example {
fn example() -> Self;
}
macro_rules! as_input {
($T:ty) => {
impl diskann_benchmark_runner::Input for $T {
type Raw = $T;
fn tag() -> &'static str {
<$T>::tag()
}
fn from_raw(
mut raw: Self::Raw,
checker: &mut diskann_benchmark_runner::Checker,
) -> anyhow::Result<Self> {
raw.validate(checker)?;
Ok(raw)
}
fn serialize(&self) -> anyhow::Result<serde_json::Value> {
Ok(serde_json::to_value(self)?)
}
fn example() -> Self {
<$T as $crate::inputs::Example>::example()
}
}
};
}
const PRINT_WIDTH: usize = 18;
macro_rules! write_field {
($f:ident, $field:tt, $($expr:tt)*) => {
writeln!($f, "{:>PRINT_WIDTH$}: {}", $field, $($expr)*)
}
}
use as_input;
use write_field;