From 662af88eb5a5bf05dd25d90f30d418b90725d6a7 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 21 Sep 2016 19:11:31 +0200 Subject: [PATCH] Impl Mail::open() --- libimagmail/src/mail.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libimagmail/src/mail.rs b/libimagmail/src/mail.rs index bc57c402..3eb07fa0 100644 --- a/libimagmail/src/mail.rs +++ b/libimagmail/src/mail.rs @@ -43,7 +43,10 @@ impl<'a> Mail<'a> { /// Opens a mail by the passed hash pub fn open>(store: &Store, hash: S) -> Result> { - unimplemented!() + Ref::get_by_hash(store, String::from(hash.as_ref())) + .map(|opt| opt.map(|r| Mail(r))) + .map_err_into(MEK::FetchByHashError) + .map_err_into(MEK::FetchError) } pub fn get_field>(&self, field: S) -> Result> {