aboutsummaryrefslogtreecommitdiff
path: root/src/mail/query.rs
diff options
context:
space:
mode:
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>>> {