Impl Mail::open()
This commit is contained in:
parent
042f286c34
commit
662af88eb5
1 changed files with 4 additions and 1 deletions
|
@ -43,7 +43,10 @@ impl<'a> Mail<'a> {
|
||||||
|
|
||||||
/// Opens a mail by the passed hash
|
/// Opens a mail by the passed hash
|
||||||
pub fn open<S: AsRef<str>>(store: &Store, hash: S) -> Result<Option<Mail>> {
|
pub fn open<S: AsRef<str>>(store: &Store, hash: S) -> Result<Option<Mail>> {
|
||||||
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<S: AsRef<str>>(&self, field: S) -> Result<Option<&str>> {
|
pub fn get_field<S: AsRef<str>>(&self, field: S) -> Result<Option<&str>> {
|
||||||
|
|
Loading…
Reference in a new issue