use std::result::Result as RResult; use std::path::Path; use libimagstore::store::{FileLockEntry, Store}; use mailparse::{MailParseError, ParsedMail, parse_mail}; use result::Result; struct Buffer(String); impl Buffer { pub fn parsed<'a>(&'a self) -> RResult, MailParseError> { parse_mail(self.0.as_bytes()) } } impl From for Buffer { fn from(data: String) -> Buffer { Buffer(data) } } pub struct Mail<'a> { fle: FileLockEntry<'a>, buffer: Buffer, } impl<'a> Mail<'a> { /// Imports a mail from the Path passed pub fn import_from_path>(store: &Store, p: P) -> Result { unimplemented!() } /// Imports a mail from the String passed pub fn import_from_string>(store: &Store, s: S) -> Result { unimplemented!() } /// Opens a mail by the passed hash pub fn open>(store: &Store, hash: S) -> Result> { unimplemented!() } pub fn get_field>(&self, field: S) -> Result> { unimplemented!() } pub fn get_from(&self) -> Result> { unimplemented!() } pub fn get_to(&self) -> Result> { unimplemented!() } pub fn get_subject(&self) -> Result> { unimplemented!() } pub fn get_message_id(&self) -> Result> { unimplemented!() } pub fn get_in_reply_to(&self) -> Result> { unimplemented!() } }