1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#![no_std]
extern crate alloc;
mod hnsw;
pub use self::hnsw::*;
pub use generic_array::{typenum, ArrayLength, GenericArray};
#[cfg(feature = "serde1")]
use serde::{Deserialize, Serialize};
#[derive(Copy, Clone, Debug)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
pub struct Params {
ef_construction: usize,
}
impl Params {
pub fn new() -> Self {
Default::default()
}
pub fn ef_construction(mut self, ef_construction: usize) -> Self {
self.ef_construction = ef_construction;
self
}
}
impl Default for Params {
fn default() -> Self {
Self {
ef_construction: 400,
}
}
}