diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2020-03-24 22:58:36 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2020-06-01 14:00:20 +0200 |
commit | 5640d4c0c070f1b32483a0d483ee8f65544888ba (patch) | |
tree | 1171891e19585b78e931ce35c40a6147035b3e3a | |
parent | d6e602948c0a540ec4544a9f1ecbd85c311a212d (diff) |
Add MailStore::entry_exists_by_id()
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r-- | lib/domain/libimagmail/src/store.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/domain/libimagmail/src/store.rs b/lib/domain/libimagmail/src/store.rs index e95a88e2..6a729dcf 100644 --- a/lib/domain/libimagmail/src/store.rs +++ b/lib/domain/libimagmail/src/store.rs @@ -144,6 +144,14 @@ impl<'a> MailStoreWithConnection<'a> { .map_err(Error::from) } + pub fn entry_exists_by_id(&self, id: &str) -> Result<bool> { + let sid = crate::module_path::new_id(id)?; + self.store + .exists(sid) + .with_context(|_| format!("Checking whether entry exists for Id: {}", id)) + .map_err(Error::from) + } + } #[derive(Debug)] |