libgitmail/
lib.rs

1//! A library that can parse git-send-email generated email
2//!
3//! Please note that this is not a general mail parser.  It is
4//! specifically built to understand mail generated by git-send-email.
5//! For a more general mail parser, maybe look at mailparse or mail
6//! instead.
7//!
8//! The important fields to get from a git email are the "In-Reply-To"
9//! and "References" header.  The `structure` method returns the basic
10//! structure of a pathset with a way to select specific parts of the
11//! set to export.  Look at the `PatchSet` type for more information.
12
13mod patch;
14pub use patch::*;
15
16pub mod set;
17pub mod tree;
18
19pub type Result<T> = std::result::Result<T, Error>;
20
21/// A mail error type
22#[derive(Debug)]
23pub enum Error {
24  /// Failed to parse the email for an unknown reason
25  FailedParsing,
26  /// The provided email is not a valid get-sent mail
27  NotAGitMail,
28  /// Generally a git email, but malformed
29  InvalidGitFormat,
30}