From 50fbc3898453257a82447d9e5a0f8e33feb42ef0 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 9 Aug 2016 15:38:35 +0200 Subject: [PATCH] Initial import of codebase --- libimagmail/src/error.rs | 10 ++++++++ libimagmail/src/mail.rs | 52 +++++++++++++++++++++++++++++++++++++++ libimagmail/src/result.rs | 6 +++++ 3 files changed, 68 insertions(+) create mode 100644 libimagmail/src/error.rs create mode 100644 libimagmail/src/mail.rs create mode 100644 libimagmail/src/result.rs diff --git a/libimagmail/src/error.rs b/libimagmail/src/error.rs new file mode 100644 index 00000000..6e3df32b --- /dev/null +++ b/libimagmail/src/error.rs @@ -0,0 +1,10 @@ +generate_error_module!( + generate_error_types!(MailError, MailErrorKind, + IOError => "IO Error" + ); +); + +pub use self::error::MailError; +pub use self::error::MailErrorKind; +pub use self::error::MapErrInto; + diff --git a/libimagmail/src/mail.rs b/libimagmail/src/mail.rs new file mode 100644 index 00000000..2fde3547 --- /dev/null +++ b/libimagmail/src/mail.rs @@ -0,0 +1,52 @@ +use std::result::Result as RResult; +use std::path::Path; + +use libimagstore::store::{FileLockEntry, Store}; + +pub struct Mail<'a> { + fle: FileLockEntry<'a>, + parsedmail: ParsedMail, +} + +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!() + } + +} diff --git a/libimagmail/src/result.rs b/libimagmail/src/result.rs new file mode 100644 index 00000000..e7715513 --- /dev/null +++ b/libimagmail/src/result.rs @@ -0,0 +1,6 @@ +use std::result::Result as RResult; + +use error::MailError; + +pub type Result = RResult; +