aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2020-01-07 17:04:27 +0000
committerKatharina Fey <kookie@spacekookie.de>2020-01-10 01:05:19 +0000
commit500f25a2fe6e1f556665a2918e23bd6ebc3de17d (patch)
treeb5ce7b6aec609a80168c469788b8c5a7ee5b6f66
parentfc7f7fc991b7dad7acf444b84929ab0c34df5ac6 (diff)
Adding first outline of libgitmail
-rw-r--r--libgitmail/Cargo.toml11
-rw-r--r--libgitmail/src/lib.rs20
2 files changed, 31 insertions, 0 deletions
diff --git a/libgitmail/Cargo.toml b/libgitmail/Cargo.toml
new file mode 100644
index 0000000..1a45357
--- /dev/null
+++ b/libgitmail/Cargo.toml
@@ -0,0 +1,11 @@
+[package]
+name = "libgitmail"
+description = "Provide an easy type-safe wrapper around git patch emails"
+version = "0.1.0"
+authors = ["Katharina Fey <kookie@spacekookie.de>"]
+edition = "2018"
+license = "GPL-3.0"
+
+[dependencies]
+mailparse = "0.10"
+nom = "5.0" \ No newline at end of file
diff --git a/libgitmail/src/lib.rs b/libgitmail/src/lib.rs
new file mode 100644
index 0000000..81de51d
--- /dev/null
+++ b/libgitmail/src/lib.rs
@@ -0,0 +1,20 @@
+//! A library that can parse git-send-email generated email
+//!
+//! Please note that this is not a general mail parser. It is
+//! specifically built to understand mail generated by git-send-email.
+//! For a more general mail parser, maybe look at mailparse or mail
+//! instead.
+//!
+//! The important fields to get from a git email are the "In-Reply-To"
+//! and "References" header. The `structure` method returns the basic
+//! structure of a pathset with a way to select specific parts of the
+//! set to export. Look at the `PatchSet` type for more information.
+
+/// A mail error type
+#[derive(Debug)]
+pub enum Error {
+ /// Failed to parse the email for an unknown reason
+ FailedParsing,
+ /// The provided email is not a valid get-sent mail
+ NotAGitMail,
+}