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
// SPDX-FileCopyrightText: 2025 Slatian
//
// SPDX-License-Identifier: LGPL-3.0-only
//! Criterium is a mini-framework to make implementing dynamic conditions and database queries easier.
//!
//! It does so by supplying the needed datastructures that can be compiled to SQL and a list of values or directly matched against a given value.
//!
//! Multiple Criteria can also be combined using Boolean logic (see [CriteriumChain]).
//!
//! Dynamic also means configurable, Criterium [integrates itself with Serde][documentation_serde].
//!
//! You can find the souce code and more documentation on [codeberg.org/unobtanium/criterium](https://codeberg.org/unobtanium/criterium).
//! # Traits to implement on your criteria
//!
//! By default, the [CriteriumChain] accepts any data type as the criterium it contains.
//!
//! However, Criterium is only really useful the criteria implement one or more of the following traits:
//!
//! * [DirectMatch] - If you want to compare against a rust data structure directly. (With known or unknown result)
//! * Also see the `rusqlite` module for traits that are needed to interoperate with rusqlite.
//!
//! # Feature flags
//!
//! * `rusqlite` - Enable compiling to SQLite SQL and rusqlite values.
//! * `chrono` - Allows using [DateTime] in place of numbers, they will be interpreted as a unix utc timestamp.
//! * `serde` - Enables serializing and deserialzing. (See the [documentation_serde] module)
//!
//! [DateTime]: https://docs.rs/chrono/latest/chrono/struct.DateTime.html
// Linting
// Explicit retuns improve readability
// Don't want to to re-implement those right now.
// Being explicit about this isn't bad, especially if multiple fields are involved.
// Tabs are for indentations so I'll use them for indentations.
// Might hide behind a feature flag later.
pub use BooleanCriterium;
pub use CriteriumChainBuilder;
pub use ChainInto;
pub use CriteriumChain;
pub use CriteriumChainList;
pub use LogicPath;
pub use NumberCriterium;
pub use StringCriterium;
pub use BooleanJoiner;
pub use DirectMatch;
pub use TagCriterium;