Helper method to parse a header value as a Content-Type header. The charset
defaults to "us-ascii" if no charset parameter is provided in the header
value.
Parse a single header from the raw data given.
This function takes raw byte data, and starts parsing it, expecting there
to be a MIME header key-value pair right at the beginning. It parses that
diff --git a/target/doc/mailparse/fn.parse_headers.html b/target/doc/mailparse/fn.parse_headers.html
index de19bfd..46099bf 100644
--- a/target/doc/mailparse/fn.parse_headers.html
+++ b/target/doc/mailparse/fn.parse_headers.html
@@ -11,7 +11,6 @@
-
@@ -44,10 +43,10 @@
Parses all the headers from the raw data given.
This function takes raw byte data, and starts parsing it, expecting there
to be zero or more MIME header key-value pair right at the beginning,
diff --git a/target/doc/mailparse/fn.parse_mail.html b/target/doc/mailparse/fn.parse_mail.html
index 37f1e34..3aec0b8 100644
--- a/target/doc/mailparse/fn.parse_mail.html
+++ b/target/doc/mailparse/fn.parse_mail.html
@@ -11,7 +11,6 @@
-
@@ -44,10 +43,10 @@
The main mail-parsing entry point.
This function takes the raw data making up the message body and returns a
structured version of it, which allows easily accessing the header and body
diff --git a/target/doc/mailparse/index.html b/target/doc/mailparse/index.html
index 67a6c4a..4921eae 100644
--- a/target/doc/mailparse/index.html
+++ b/target/doc/mailparse/index.html
@@ -11,7 +11,6 @@
-
@@ -44,76 +43,82 @@
A struct that represents a single header in the message.
It holds slices into the raw byte array passed to parse_mail, and so the
lifetime of this struct must be contained within the lifetime of the raw
input. There are additional accessor functions on this struct to extract
the data as Rust strings.
A struct to hold a more structured representation of the Content-Type header.
This is provided mostly as a convenience since this metadata is usually
needed to interpret the message body properly.
Struct that holds the structured representation of the message. Note that
since MIME allows for nested multipart messages, a tree-like structure is
necessary to represent it properly. This struct accomplishes that by holding
a vector of other ParsedMail structures for the subparts.
A trait that is implemented by the Vec returned by the parse_headers
function. It provides a map-like interface to look up header values by their
name.
Helper method to parse a header value as a Content-Type header. The charset
defaults to "us-ascii" if no charset parameter is provided in the header
value.
Parse a single header from the raw data given.
This function takes raw byte data, and starts parsing it, expecting there
to be a MIME header key-value pair right at the beginning. It parses that
header and returns it, along with the index at which the next header is
@@ -121,13 +126,14 @@ expected to start. If you just want to parse a single header, you can ignore
the second component of the tuple, which is the index of the next header.
Error values are returned if the data could not be successfully interpreted
as a MIME key-value pair.
Parses all the headers from the raw data given.
This function takes raw byte data, and starts parsing it, expecting there
to be zero or more MIME header key-value pair right at the beginning,
followed by two consecutive newlines (i.e. a blank line). It parses those
@@ -138,18 +144,20 @@ returns the index at which the message body is expected to start. If you
just care about the headers, you can ignore the second component of the
returned tuple.
Error values are returned if there was some sort of parsing error.
The main mail-parsing entry point.
This function takes the raw data making up the message body and returns a
structured version of it, which allows easily accessing the header and body
information as needed.
-
-
+
+
+
diff --git a/target/doc/mailparse/macros/index.html b/target/doc/mailparse/macros/index.html
deleted file mode 100644
index e69de29..0000000
diff --git a/target/doc/mailparse/macros/sidebar-items.js b/target/doc/mailparse/macros/sidebar-items.js
deleted file mode 100644
index 48333d3..0000000
--- a/target/doc/mailparse/macros/sidebar-items.js
+++ /dev/null
@@ -1 +0,0 @@
-initSidebarItems({});
\ No newline at end of file
diff --git a/target/doc/mailparse/struct.MailHeader.html b/target/doc/mailparse/struct.MailHeader.html
index a5d1caa..56798f4 100644
--- a/target/doc/mailparse/struct.MailHeader.html
+++ b/target/doc/mailparse/struct.MailHeader.html
@@ -11,7 +11,6 @@
-
@@ -44,10 +43,10 @@
pub struct ParsedContentType {
pub mimetype: String,
pub charset: String,
@@ -57,16 +56,16 @@ This is provided mostly as a convenience since this metadata is usually
needed to interpret the message body properly.
Fields
-
mimetype
The type of the data, for example "text/plain" or "application/pdf".
+
mimetype
The type of the data, for example "text/plain" or "application/pdf".
-
charset
The charset used to decode the raw byte data, for example "iso-8859-1"
+
charset
The charset used to decode the raw byte data, for example "iso-8859-1"
or "utf-8".
-
boundary
The boundary used to separate the different parts of a multipart message.
+
boundary
The boundary used to separate the different parts of a multipart message.
This boundary is taken straight from the Content-Type header, and so
the body will actually contain the boundary string prefixed by two
dashes.
pub struct ParsedMail<'a> {
pub headers: Vec<MailHeader<'a>>,
pub ctype: ParsedContentType,
@@ -59,11 +58,11 @@ necessary to represent it properly. This struct accomplishes that by holding
a vector of other ParsedMail structures for the subparts.
Fields
-
headers
The headers for the message (or message subpart).
+
headers
The headers for the message (or message subpart).
-
ctype
The Content-Type information for the message (or message subpart).
+
ctype
The Content-Type information for the message (or message subpart).
-
subparts
The subparts of this message or subpart. This vector is only non-empty
+
subparts
The subparts of this message or subpart. This vector is only non-empty
if ctype.mimetype starts with "multipart/".
Get the body of the message as a Rust string. This function tries to
@@ -80,7 +79,7 @@ the result into a Rust UTF-8 string using the charset in the Content-Type
"This is the body").as_bytes())
.unwrap();
assert_eq!(p.get_body().unwrap(), "This is the body");
-
A trait that is implemented by the Vec returned by the parse_headers
function. It provides a map-like interface to look up header values by their
name.
@@ -70,6 +71,9 @@ header was found.
"This is a test message").as_bytes())
.unwrap().headers;
assert_eq!(headers.get_first_value("Subject").unwrap(), Some("Test".to_string()));
+
Same as get_first_value, but does a case-insensitive search for the header.
+According to the spec the mail headers are supposed to be case-sensitive,
+but in real-world scenarios that's not always the case.
Look through the list of headers and return the values of all headers
matching the provided key. Returns an empty vector if no matching headers
were found. The order of the returned values is the same as the order
@@ -84,13 +88,16 @@ of the matching headers in the message.
Same as get_all_values, but does a case-insensitive search for the header.
+According to the spec the mail headers are supposed to be case-sensitive,
+but in real-world scenarios that's not always the case.
+ src="../implementors/mailparse/trait.MailHeaderMap.js">
+
diff --git a/target/doc/main.js b/target/doc/main.js
index 1d1e789..f3efbcb 100644
--- a/target/doc/main.js
+++ b/target/doc/main.js
@@ -740,9 +740,7 @@
$(".search-input").on("keyup input",function() {
clearTimeout(searchTimeout);
if ($(this).val().length === 0) {
- if (browserSupportsHistoryApi()) {
- history.replaceState("", "std - Rust", "?search=");
- }
+ window.history.replaceState("", "std - Rust", "?search=");
$('#main.content').removeClass('hidden');
$('#search.content').addClass('hidden');
} else {
@@ -998,7 +996,7 @@
var prev_id = 0;
function set_fragment(name) {
- if (browserSupportsHistoryApi()) {
+ if (history.replaceState) {
history.replaceState(null, null, '#' + name);
$(window).trigger('hashchange');
} else {
diff --git a/target/doc/rustdoc.css b/target/doc/rustdoc.css
index c07871a..1cadc4e 100644
--- a/target/doc/rustdoc.css
+++ b/target/doc/rustdoc.css
@@ -616,19 +616,15 @@ a.test-arrow {
}
.sidebar .location {
- float: right;
+ float: left;
margin: 0px;
- padding: 3px 10px 1px 10px;
- min-height: 39px;
+ padding: 5px;
+ width: 60%;
background: inherit;
text-align: left;
font-size: 24px;
}
- .sidebar .location:empty {
- padding: 0;
- }
-
.sidebar img {
width: 35px;
margin-top: 5px;
diff --git a/target/doc/search-index.js b/target/doc/search-index.js
index f6effd9..62b5679 100644
--- a/target/doc/search-index.js
+++ b/target/doc/search-index.js
@@ -1,3 +1,3 @@
var searchIndex = {};
-searchIndex["mailparse"] = {"doc":"","items":[[3,"MailHeader","mailparse","A struct that represents a single header in the message.\nIt holds slices into the raw byte array passed to parse_mail, and so the\nlifetime of this struct must be contained within the lifetime of the raw\ninput. There are additional accessor functions on this struct to extract\nthe data as Rust strings.",null,null],[3,"ParsedContentType","","A struct to hold a more structured representation of the Content-Type header.\nThis is provided mostly as a convenience since this metadata is usually\nneeded to interpret the message body properly.",null,null],[12,"mimetype","","The type of the data, for example "text/plain" or "application/pdf".",0,null],[12,"charset","","The charset used to decode the raw byte data, for example "iso-8859-1"\nor "utf-8".",0,null],[12,"boundary","","The boundary used to separate the different parts of a multipart message.\nThis boundary is taken straight from the Content-Type header, and so\nthe body will actually contain the boundary string prefixed by two\ndashes.",0,null],[3,"ParsedMail","","Struct that holds the structured representation of the message. Note that\nsince MIME allows for nested multipart messages, a tree-like structure is\nnecessary to represent it properly. This struct accomplishes that by holding\na vector of other ParsedMail structures for the subparts.",null,null],[12,"headers","","The headers for the message (or message subpart).",1,null],[12,"ctype","","The Content-Type information for the message (or message subpart).",1,null],[12,"subparts","","The subparts of this message or subpart. This vector is only non-empty\nif ctype.mimetype starts with "multipart/".",1,null],[4,"MailParseError","","An error type that represents the different kinds of errors that may be\nencountered during message parsing.",null,null],[13,"QuotedPrintableDecodeError","","Data that was specified as being in the quoted-printable transfer-encoding\ncould not be successfully decoded as quoted-printable data.",2,null],[13,"Base64DecodeError","","Data that was specified as being in the base64 transfer-encoding could\nnot be successfully decoded as base64 data.",2,null],[13,"EncodingError","","An error occurred when converting the raw byte data to Rust UTF-8 string\nformat using the charset specified in the message.",2,null],[13,"Generic","","Some other error occurred while parsing the message; the description string\nprovides additional details.",2,null],[5,"parse_header","","Parse a single header from the raw data given.\nThis function takes raw byte data, and starts parsing it, expecting there\nto be a MIME header key-value pair right at the beginning. It parses that\nheader and returns it, along with the index at which the next header is\nexpected to start. If you just want to parse a single header, you can ignore\nthe second component of the tuple, which is the index of the next header.\nError values are returned if the data could not be successfully interpreted\nas a MIME key-