aboutsummaryrefslogtreecommitdiff
path: root/src/mail/query.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2024-01-06 18:01:44 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2024-01-06 18:01:44 +0100
commitf58904f5bb3dbd429555c406c867f850654843a6 (patch)
tree9b5d62e88dce84fe33cfe1f87ef7e3fb3e23cc2e /src/mail/query.rs
parentd495538d55c723d8a088c32327258ce10c555a2e (diff)
downloadaerogramme-f58904f5bb3dbd429555c406c867f850654843a6.tar.gz
aerogramme-f58904f5bb3dbd429555c406c867f850654843a6.zip
Search can now filter on index data
Diffstat (limited to 'src/mail/query.rs')
-rw-r--r--src/mail/query.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mail/query.rs b/src/mail/query.rs
index 8de73e6..91bd6c1 100644
--- a/src/mail/query.rs
+++ b/src/mail/query.rs
@@ -19,6 +19,15 @@ pub enum QueryScope {
Partial,
Full,
}
+impl QueryScope {
+ pub fn union(&self, other: &QueryScope) -> QueryScope {
+ match (self, other) {
+ (QueryScope::Full, _) | (_, QueryScope::Full) => QueryScope::Full,
+ (QueryScope::Partial, _) | (_, QueryScope::Partial) => QueryScope::Partial,
+ (QueryScope::Index, QueryScope::Index) => QueryScope::Index,
+ }
+ }
+}
impl<'a, 'b> Query<'a, 'b> {
pub async fn fetch(&self) -> Result<Vec<QueryResult<'a>>> {