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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/// Query is a recursive datatype that describes a
/// query to a search index or engine.
///
/// The query only takes strings as parameters. It is up to the
/// search index to parse this string into the expected type.
///
/// # Example
/// ```
/// use attribute_search_engine::Query;
///
/// let q = Query::Exclude(
/// Box::new(Query::And(vec![
/// Query::Or(vec![
/// Query::InRange("a".into(), "32".into(), "128".into()),
/// Query::Prefix("b".into(), "hello".into()),
/// ]),
/// Query::Minimum("c".into(), "42".into()),
/// ])),
/// vec![
/// Query::Exact("b".into(), "hello world".into()),
/// ],
/// );
/// ```
/// Bitmask type for queries that are supported by an index.
pub type SupportedQueries = u8;
/// Signals that an index supports [Exact queries](Query::Exact).
pub const SUPPORTS_EXACT: SupportedQueries = 1 << 0;
/// Signals that an index supports [Prefix queries](Query::Prefix).
pub const SUPPORTS_PREFIX: SupportedQueries = 1 << 1;
/// Signals that an index supports [InRange queries](Query::InRange).
pub const SUPPORTS_INRANGE: SupportedQueries = 1 << 2;
/// Signals that an index supports [OutRange queries](Query::OutRange).
pub const SUPPORTS_OUTRANGE: SupportedQueries = 1 << 3;
/// Signals that an index supports [Minimum queries](Query::Minimum).
pub const SUPPORTS_MINIMUM: SupportedQueries = 1 << 4;
/// Signals that an index supports [Maximum queries](Query::Maximum).
pub const SUPPORTS_MAXIMUM: SupportedQueries = 1 << 5;