use serde::Deserialize;
use std::fs::File;
use std::io::prelude::*;
#[derive(Debug, Deserialize)]
struct RektorDB {
data: Vec<f32>,
proximity: f32,
}
fn main() {
let mut file = File::open("samples/vector.json").expect("Vector DB not found");
let mut contents = String::new();
file.read_to_string(&mut contents).expect("Failed to read DB");
let data: Vec<RektorDB> = serde_json::from_str(&contents).expect("Failed to parse DB");
println!("{:#?}", data);
}
Usage :