diskann_label_filter/query.rs
1/*
2 * Copyright (c) Microsoft Corporation.
3 * Licensed under the MIT license.
4 */
5
6use crate::ASTExpr;
7
8/// Type that can be used to specify a query with a filter expression.
9/// The Readme.md file in the label-filter folder describes the format
10/// of the query expression.
11#[derive(Clone)]
12pub struct FilteredQuery<V> {
13 query: V,
14 filter_expr: ASTExpr,
15}
16
17impl<V> FilteredQuery<V> {
18 pub fn new(query: V, filter_expr: ASTExpr) -> Self {
19 Self { query, filter_expr }
20 }
21
22 pub(crate) fn query(&self) -> &V {
23 &self.query
24 }
25
26 pub(crate) fn filter_expr(&self) -> &ASTExpr {
27 &self.filter_expr
28 }
29}