From a48bf7ece27e4f52d980b5668abe49cf046255e8 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Wed, 22 Jun 2016 11:41:54 -0400 Subject: Update documentation --- target/doc/mailparse/enum.MailParseError.html | 21 ++- target/doc/mailparse/fn.parse_content_type.html | 9 +- target/doc/mailparse/fn.parse_header.html | 9 +- target/doc/mailparse/fn.parse_headers.html | 9 +- target/doc/mailparse/fn.parse_mail.html | 9 +- target/doc/mailparse/index.html | 144 ++++++++++--------- target/doc/mailparse/macros/index.html | 0 target/doc/mailparse/macros/sidebar-items.js | 1 - target/doc/mailparse/struct.MailHeader.html | 11 +- target/doc/mailparse/struct.ParsedContentType.html | 17 ++- target/doc/mailparse/struct.ParsedMail.html | 17 ++- target/doc/mailparse/trait.MailHeaderMap.html | 21 ++- target/doc/main.js | 6 +- target/doc/rustdoc.css | 10 +- target/doc/search-index.js | 2 +- target/doc/src/mailparse/src/lib.rs.html | 153 +++++++++++++++++++-- target/doc/src/mailparse/src/macros.rs.html | 124 ----------------- 17 files changed, 288 insertions(+), 275 deletions(-) delete mode 100644 target/doc/mailparse/macros/index.html delete mode 100644 target/doc/mailparse/macros/sidebar-items.js delete mode 100644 target/doc/src/mailparse/src/macros.rs.html diff --git a/target/doc/mailparse/enum.MailParseError.html b/target/doc/mailparse/enum.MailParseError.html index 3afc258..061e8f1 100644 --- a/target/doc/mailparse/enum.MailParseError.html +++ b/target/doc/mailparse/enum.MailParseError.html @@ -11,7 +11,6 @@ - @@ -44,10 +43,10 @@

Enum mailparse::MailParseError - - [] - - [src]

+ + [] + + [src]
pub enum MailParseError {
     QuotedPrintableDecodeError(QuotedPrintableError),
     Base64DecodeError(Base64Error),
@@ -64,13 +63,13 @@ not be successfully decoded as base64 data.

format using the charset specified in the message.

Generic

Some other error occurred while parsing the message; the description string provides additional details.

-

Trait Implementations

impl Display for MailParseError

fn fmt(&self, f: &mut Formatter) -> Result

-

impl Error for MailParseError

fn description(&self) -> &str

+

Trait Implementations

impl Display for MailParseError

fn fmt(&self, f: &mut Formatter) -> Result

+

impl Error for MailParseError

fn description(&self) -> &str

fn cause(&self) -> Option<&Error>

-

impl From<QuotedPrintableError> for MailParseError

fn from(err: QuotedPrintableError) -> MailParseError

-

impl From<Base64Error> for MailParseError

fn from(err: Base64Error) -> MailParseError

-

impl From<Cow<'static, str>> for MailParseError

fn from(err: Cow<'static, str>) -> MailParseError

-

Derived Implementations

impl Debug for MailParseError

fn fmt(&self, __arg_0: &mut Formatter) -> Result

+

impl From<QuotedPrintableError> for MailParseError

fn from(err: QuotedPrintableError) -> MailParseError

+

impl From<Base64Error> for MailParseError

fn from(err: Base64Error) -> MailParseError

+

impl From<Cow<'static, str>> for MailParseError

fn from(err: Cow<'static, str>) -> MailParseError

+

Derived Implementations

impl Debug for MailParseError

fn fmt(&self, __arg_0: &mut Formatter) -> Result

diff --git a/target/doc/mailparse/fn.parse_content_type.html b/target/doc/mailparse/fn.parse_content_type.html index db5e848..4dd010d 100644 --- a/target/doc/mailparse/fn.parse_content_type.html +++ b/target/doc/mailparse/fn.parse_content_type.html @@ -11,7 +11,6 @@ - @@ -44,10 +43,10 @@

Function mailparse::parse_content_type - - [] - - [src]

+ + [] + + [src]
pub fn parse_content_type(header: &str) -> Result<ParsedContentType, MailParseError>

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.

diff --git a/target/doc/mailparse/fn.parse_header.html b/target/doc/mailparse/fn.parse_header.html index e08f664..8b053a4 100644 --- a/target/doc/mailparse/fn.parse_header.html +++ b/target/doc/mailparse/fn.parse_header.html @@ -11,7 +11,6 @@ - @@ -44,10 +43,10 @@

Function mailparse::parse_header - - [] - - [src]

+ + [] + + [src]
pub fn parse_header(raw_data: &[u8]) -> Result<(MailHeader, usize), MailParseError>

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 @@

Function mailparse::parse_headers - - [] - - [src]

+ + [] + + [src]
pub fn parse_headers(raw_data: &[u8]) -> Result<(Vec<MailHeader>, usize), MailParseError>

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 @@

Function mailparse::parse_mail - - [] - - [src]

+ + [] + + [src]
pub fn parse_mail(raw_data: &[u8]) -> Result<ParsedMail, MailParseError>

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 @@

Crate mailparse - - [] - - [src]

+ + [] + + [src]

Structs

- - - + + - - - - + + + + + - - - - + + + + + -
MailHeader -

A struct that represents a single header in the message. +

MailHeader +

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.

-
ParsedContentType -

A struct to hold a more structured representation of the Content-Type header. +

ParsedContentType +

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.

-
ParsedMail -

Struct that holds the structured representation of the message. Note that +

ParsedMail +

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.

-

Enums

+ + +

Enums

- - - + + -
MailParseError -

An error type that represents the different kinds of errors that may be +

MailParseError +

An error type that represents the different kinds of errors that may be encountered during message parsing.

-

Traits

+ + +

Traits

- - - + + -
MailHeaderMap -

A trait that is implemented by the Vec returned by the parse_headers +

MailHeaderMap +

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.

-

Functions

+ + +

Functions

- - - + + - - - - + + + + + - - - - + + + + + - - - - + + + + + -
parse_content_type -

Helper method to parse a header value as a Content-Type header. The charset +

parse_content_type +

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_header -

Parse a single header from the raw data given. +

parse_header +

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.

-
parse_headers -

Parses all the headers from the raw data given. +

parse_headers +

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.

-
parse_mail -

The main mail-parsing entry point. +

parse_mail +

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 @@

Struct mailparse::MailHeader - - [] - - [src]

+ + [] + + [src]
pub struct MailHeader<'a> {
     // some fields omitted
 }

A struct that represents a single header in the message. @@ -70,7 +69,7 @@ any quoted-printable words in the value are decoded.

let (parsed, _) = parse_header(b"Subject: =?iso-8859-1?Q?=A1Hola,_se=F1or!?=").unwrap(); assert_eq!(parsed.get_key().unwrap(), "Subject"); assert_eq!(parsed.get_value().unwrap(), "\u{a1}Hola, se\u{f1}or!"); -

Trait Implementations

Derived Implementations

impl<'a> Debug for MailHeader<'a>

fn fmt(&self, __arg_0: &mut Formatter) -> Result

+

Trait Implementations

Derived Implementations

impl<'a> Debug for MailHeader<'a>

fn fmt(&self, __arg_0: &mut Formatter) -> Result

diff --git a/target/doc/mailparse/struct.ParsedContentType.html b/target/doc/mailparse/struct.ParsedContentType.html index 9de1a7d..59f1785 100644 --- a/target/doc/mailparse/struct.ParsedContentType.html +++ b/target/doc/mailparse/struct.ParsedContentType.html @@ -11,7 +11,6 @@ - @@ -44,10 +43,10 @@

Struct mailparse::ParsedContentType - - [] - - [src]

+ + [] + + [src]
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.

-

Trait Implementations

Derived Implementations

impl Debug for ParsedContentType

fn fmt(&self, __arg_0: &mut Formatter) -> Result

+

Trait Implementations

Derived Implementations

impl Debug for ParsedContentType

fn fmt(&self, __arg_0: &mut Formatter) -> Result

diff --git a/target/doc/mailparse/struct.ParsedMail.html b/target/doc/mailparse/struct.ParsedMail.html index 0a7ff79..4939d24 100644 --- a/target/doc/mailparse/struct.ParsedMail.html +++ b/target/doc/mailparse/struct.ParsedMail.html @@ -11,7 +11,6 @@ - @@ -44,10 +43,10 @@

Struct mailparse::ParsedMail - - [] - - [src]

+ + [] + + [src]
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/".

Methods

impl<'a> ParsedMail<'a>

fn get_body(&self) -> Result<String, MailParseError>

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");

-

Trait Implementations

Derived Implementations

impl<'a> Debug for ParsedMail<'a>

fn fmt(&self, __arg_0: &mut Formatter) -> Result

+

Trait Implementations

Derived Implementations

impl<'a> Debug for ParsedMail<'a>

fn fmt(&self, __arg_0: &mut Formatter) -> Result

diff --git a/target/doc/mailparse/trait.MailHeaderMap.html b/target/doc/mailparse/trait.MailHeaderMap.html index 2d57bc0..1404825 100644 --- a/target/doc/mailparse/trait.MailHeaderMap.html +++ b/target/doc/mailparse/trait.MailHeaderMap.html @@ -11,7 +11,6 @@ - @@ -44,13 +43,15 @@

Trait mailparse::MailHeaderMap - - [] - - [src]

+ + [] + + [src]
pub trait MailHeaderMap {
     fn get_first_value(&self, key: &str) -> Result<Option<String>, MailParseError>;
+    fn get_first_value_ci(&self, key: &str) -> Result<Option<String>, MailParseError>;
     fn get_all_values(&self, key: &str) -> Result<Vec<String>, MailParseError>;
+    fn get_all_values_ci(&self, key: &str) -> Result<Vec<String>, MailParseError>;
 }

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())); +

fn get_first_value_ci(&self, key: &str) -> Result<Option<String>, MailParseError>

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.

fn get_all_values(&self, key: &str) -> Result<Vec<String>, MailParseError>

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.

.unwrap().headers; assert_eq!(headers.get_all_values("Key").unwrap(), vec!["Value1".to_string(), "Value2".to_string()]); +

fn get_all_values_ci(&self, key: &str) -> Result<Vec<String>, MailParseError>

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.

Implementors

+ 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-