Skip to main content

diskann_label_filter/
document.rs

1/*
2 * Copyright (c) Microsoft Corporation.
3 * Licensed under the MIT license.
4 */
5
6use crate::attribute::Attribute;
7
8/// Simple container class that clients can use to
9/// supply diskann with a vector and its attributes
10pub struct Document<'a, V> {
11    vector: &'a V,
12    attributes: Vec<Attribute>,
13}
14
15impl<'a, V> Document<'a, V> {
16    pub fn new(vector: &'a V, attributes: Vec<Attribute>) -> Self {
17        Self { vector, attributes }
18    }
19
20    pub(crate) fn vector(&self) -> &'a V {
21        self.vector
22    }
23
24    pub(crate) fn attributes(&self) -> &Vec<Attribute> {
25        &self.attributes
26    }
27}