From 26778c0038723311c64cc5ddcaaaf9dc81fa83c6 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Fri, 11 Nov 2016 11:35:34 -0500 Subject: Update documentation --- target/doc/implementors/core/convert/trait.From.js | 2 +- target/doc/implementors/core/fmt/trait.Debug.js | 2 +- target/doc/implementors/core/fmt/trait.Display.js | 2 +- .../implementors/mailparse/trait.MailHeaderMap.js | 2 +- target/doc/implementors/std/error/trait.Error.js | 2 +- target/doc/mailparse/fn.parse_content_type.html | 2 +- target/doc/mailparse/fn.parse_headers.html | 2 +- target/doc/mailparse/fn.parse_mail.html | 2 +- target/doc/mailparse/index.html | 2 +- target/doc/mailparse/struct.MailHeader.html | 2 +- target/doc/mailparse/struct.ParsedContentType.html | 2 +- target/doc/mailparse/struct.ParsedMail.html | 2 +- target/doc/mailparse/trait.MailHeaderMap.html | 15 ++--- target/doc/search-index.js | 2 +- target/doc/src/mailparse/src/lib.rs.html | 68 ++-------------------- 15 files changed, 23 insertions(+), 86 deletions(-) diff --git a/target/doc/implementors/core/convert/trait.From.js b/target/doc/implementors/core/convert/trait.From.js index 6db984e..00678ce 100644 --- a/target/doc/implementors/core/convert/trait.From.js +++ b/target/doc/implementors/core/convert/trait.From.js @@ -1,5 +1,5 @@ (function() {var implementors = {}; -implementors['mailparse'] = ["impl From<QuotedPrintableError> for MailParseError","impl From<Base64Error> for MailParseError","impl From<Cow<'static, str>> for MailParseError",];implementors['mailparse'] = ["impl From<QuotedPrintableError> for MailParseError","impl From<Base64Error> for MailParseError","impl From<Cow<'static, str>> for MailParseError",]; +implementors['mailparse'] = ["impl From<QuotedPrintableError> for MailParseError","impl From<Base64Error> for MailParseError","impl From<Cow<'static, str>> for MailParseError",];implementors['mailparse'] = ["impl From<QuotedPrintableError> for MailParseError","impl From<Base64Error> for MailParseError","impl From<Cow<'static, str>> for MailParseError",];implementors['mailparse'] = ["impl From<QuotedPrintableError> for MailParseError","impl From<Base64Error> for MailParseError","impl From<Cow<'static, str>> for MailParseError",]; if (window.register_implementors) { window.register_implementors(implementors); diff --git a/target/doc/implementors/core/fmt/trait.Debug.js b/target/doc/implementors/core/fmt/trait.Debug.js index b14d3b3..2f270d1 100644 --- a/target/doc/implementors/core/fmt/trait.Debug.js +++ b/target/doc/implementors/core/fmt/trait.Debug.js @@ -1,5 +1,5 @@ (function() {var implementors = {}; -implementors['mailparse'] = ["impl Debug for MailParseError","impl<'a> Debug for MailHeader<'a>","impl Debug for ParsedContentType","impl<'a> Debug for ParsedMail<'a>",];implementors['mailparse'] = ["impl Debug for MailParseError","impl<'a> Debug for MailHeader<'a>","impl Debug for ParsedContentType","impl<'a> Debug for ParsedMail<'a>",]; +implementors['mailparse'] = ["impl Debug for MailParseError","impl<'a> Debug for MailHeader<'a>","impl Debug for ParsedContentType","impl<'a> Debug for ParsedMail<'a>",];implementors['mailparse'] = ["impl Debug for MailParseError","impl<'a> Debug for MailHeader<'a>","impl Debug for ParsedContentType","impl<'a> Debug for ParsedMail<'a>",];implementors['mailparse'] = ["impl Debug for MailParseError","impl<'a> Debug for MailHeader<'a>","impl Debug for ParsedContentType","impl<'a> Debug for ParsedMail<'a>",]; if (window.register_implementors) { window.register_implementors(implementors); diff --git a/target/doc/implementors/core/fmt/trait.Display.js b/target/doc/implementors/core/fmt/trait.Display.js index bb28343..ff2d722 100644 --- a/target/doc/implementors/core/fmt/trait.Display.js +++ b/target/doc/implementors/core/fmt/trait.Display.js @@ -1,5 +1,5 @@ (function() {var implementors = {}; -implementors['mailparse'] = ["impl Display for MailParseError",];implementors['mailparse'] = ["impl Display for MailParseError",]; +implementors['mailparse'] = ["impl Display for MailParseError",];implementors['mailparse'] = ["impl Display for MailParseError",];implementors['mailparse'] = ["impl Display for MailParseError",]; if (window.register_implementors) { window.register_implementors(implementors); diff --git a/target/doc/implementors/mailparse/trait.MailHeaderMap.js b/target/doc/implementors/mailparse/trait.MailHeaderMap.js index afa564b..7868a61 100644 --- a/target/doc/implementors/mailparse/trait.MailHeaderMap.js +++ b/target/doc/implementors/mailparse/trait.MailHeaderMap.js @@ -1,5 +1,5 @@ (function() {var implementors = {}; -implementors['mailparse'] = [];implementors['mailparse'] = []; +implementors['mailparse'] = [];implementors['mailparse'] = [];implementors['mailparse'] = []; if (window.register_implementors) { window.register_implementors(implementors); diff --git a/target/doc/implementors/std/error/trait.Error.js b/target/doc/implementors/std/error/trait.Error.js index ed55323..6563070 100644 --- a/target/doc/implementors/std/error/trait.Error.js +++ b/target/doc/implementors/std/error/trait.Error.js @@ -1,5 +1,5 @@ (function() {var implementors = {}; -implementors['mailparse'] = ["impl Error for MailParseError",];implementors['mailparse'] = ["impl Error for MailParseError",]; +implementors['mailparse'] = ["impl Error for MailParseError",];implementors['mailparse'] = ["impl Error for MailParseError",];implementors['mailparse'] = ["impl Error for MailParseError",]; if (window.register_implementors) { window.register_implementors(implementors); diff --git a/target/doc/mailparse/fn.parse_content_type.html b/target/doc/mailparse/fn.parse_content_type.html index e81fb02..08ef924 100644 --- a/target/doc/mailparse/fn.parse_content_type.html +++ b/target/doc/mailparse/fn.parse_content_type.html @@ -47,7 +47,7 @@ [] - [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_headers.html b/target/doc/mailparse/fn.parse_headers.html index 9a86a17..c5e42be 100644 --- a/target/doc/mailparse/fn.parse_headers.html +++ b/target/doc/mailparse/fn.parse_headers.html @@ -47,7 +47,7 @@ [] - [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 509783e..95d75aa 100644 --- a/target/doc/mailparse/fn.parse_mail.html +++ b/target/doc/mailparse/fn.parse_mail.html @@ -47,7 +47,7 @@ [] - [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 5b6e8a4..83af7c0 100644 --- a/target/doc/mailparse/index.html +++ b/target/doc/mailparse/index.html @@ -47,7 +47,7 @@ [] - [src] + [src]

Structs

diff --git a/target/doc/mailparse/struct.MailHeader.html b/target/doc/mailparse/struct.MailHeader.html index 0313162..0160a89 100644 --- a/target/doc/mailparse/struct.MailHeader.html +++ b/target/doc/mailparse/struct.MailHeader.html @@ -56,7 +56,7 @@ 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.

Methods

impl<'a> MailHeader<'a>

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

-

Get the name of the header. Note that header names are case-sensitive.

+

Get the name of the header. Note that header names are case-insensitive.

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

Get the value of the header. Any sequences of newlines characters followed by whitespace are collapsed into a single space. In effect, header values diff --git a/target/doc/mailparse/struct.ParsedContentType.html b/target/doc/mailparse/struct.ParsedContentType.html index d9e362b..8d4d189 100644 --- a/target/doc/mailparse/struct.ParsedContentType.html +++ b/target/doc/mailparse/struct.ParsedContentType.html @@ -47,7 +47,7 @@ [] - [src] + [src]

pub struct ParsedContentType {
     pub mimetype: String,
     pub charset: String,
diff --git a/target/doc/mailparse/struct.ParsedMail.html b/target/doc/mailparse/struct.ParsedMail.html
index d298da8..5446417 100644
--- a/target/doc/mailparse/struct.ParsedMail.html
+++ b/target/doc/mailparse/struct.ParsedMail.html
@@ -47,7 +47,7 @@
                    
                        []
                    
-               [src]
+               [src]
 
pub struct ParsedMail<'a> {
     pub headers: Vec<MailHeader<'a>>,
     pub ctype: ParsedContentType,
diff --git a/target/doc/mailparse/trait.MailHeaderMap.html b/target/doc/mailparse/trait.MailHeaderMap.html
index 44ebe60..245b416 100644
--- a/target/doc/mailparse/trait.MailHeaderMap.html
+++ b/target/doc/mailparse/trait.MailHeaderMap.html
@@ -47,12 +47,10 @@
                    
                        []
                    
-               [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.

@@ -61,7 +59,7 @@ name.

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

Look through the list of headers and return the value of the first one that matches the provided key. It returns Ok(None) if the no matching -header was found.

+header was found. Header names are matched case-insensitively.

Examples

@@ -72,13 +70,11 @@ 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 -of the matching headers in the message.

+of the matching headers in the message. Header names are matched +case-insensitively.

Examples

@@ -89,9 +85,6 @@ 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

    diff --git a/target/doc/search-index.js b/target/doc/search-index.js index fdb4668..762ebe3 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,"dateparse","","Convert a date field from an email header into a UNIX epoch timestamp.\nThis function handles the most common formatting of date fields found in\nemail headers. It may fail to parse some of the more creative formattings.",null,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[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-value pair.",null,null],[5,"parse_headers","","Parses all the headers from the raw data given.\nThis function takes raw byte data, and starts parsing it, expecting there\nto be zero or more MIME header key-value pair right at the beginning,\nfollowed by two consecutive newlines (i.e. a blank line). It parses those\nheaders and returns them in a vector. The normal vector functions can be\nused to access the headers linearly, or the MailHeaderMap trait can be used\nto access them in a map-like fashion. Along with this vector, the function\nreturns the index at which the message body is expected to start. If you\njust care about the headers, you can ignore the second component of the\nreturned tuple.\nError values are returned if there was some sort of parsing error.",null,null],[5,"parse_content_type","","Helper method to parse a header value as a Content-Type header. The charset\ndefaults to "us-ascii" if no charset parameter is provided in the header\nvalue.",null,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[5,"parse_mail","","The main mail-parsing entry point.\nThis function takes the raw data making up the message body and returns a\nstructured version of it, which allows easily accessing the header and body\ninformation as needed.",null,null],[8,"MailHeaderMap","","A trait that is implemented by the Vec<MailHeader> returned by the parse_headers\nfunction. It provides a map-like interface to look up header values by their\nname.",null,null],[10,"get_first_value","","Look through the list of headers and return the value of the first one\nthat matches the provided key. It returns Ok(None) if the no matching\nheader was found.",3,{"inputs":[{"name":"mailheadermap"},{"name":"str"}],"output":{"name":"result"}}],[10,"get_first_value_ci","","Same as get_first_value, but does a case-insensitive search for the header.\nAccording to the spec the mail headers are supposed to be case-sensitive,\nbut in real-world scenarios that's not always the case.",3,{"inputs":[{"name":"mailheadermap"},{"name":"str"}],"output":{"name":"result"}}],[10,"get_all_values","","Look through the list of headers and return the values of all headers\nmatching the provided key. Returns an empty vector if no matching headers\nwere found. The order of the returned values is the same as the order\nof the matching headers in the message.",3,{"inputs":[{"name":"mailheadermap"},{"name":"str"}],"output":{"name":"result"}}],[10,"get_all_values_ci","","Same as get_all_values, but does a case-insensitive search for the header.\nAccording to the spec the mail headers are supposed to be case-sensitive,\nbut in real-world scenarios that's not always the case.",3,{"inputs":[{"name":"mailheadermap"},{"name":"str"}],"output":{"name":"result"}}],[11,"fmt","","",2,{"inputs":[{"name":"mailparseerror"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",2,{"inputs":[{"name":"mailparseerror"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"description","","",2,{"inputs":[{"name":"mailparseerror"}],"output":{"name":"str"}}],[11,"cause","","",2,{"inputs":[{"name":"mailparseerror"}],"output":{"name":"option"}}],[11,"from","","",2,{"inputs":[{"name":"quotedprintableerror"}],"output":{"name":"mailparseerror"}}],[11,"from","","",2,{"inputs":[{"name":"base64error"}],"output":{"name":"mailparseerror"}}],[11,"from","","",2,{"inputs":[{"name":"cow"}],"output":{"name":"mailparseerror"}}],[11,"fmt","","",4,{"inputs":[{"name":"mailheader"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"get_key","","Get the name of the header. Note that header names are case-sensitive.",4,{"inputs":[{"name":"mailheader"}],"output":{"name":"result"}}],[11,"get_value","","Get the value of the header. Any sequences of newlines characters followed\nby whitespace are collapsed into a single space. In effect, header values\nwrapped across multiple lines are compacted back into one line, while\ndiscarding the extra whitespace required by the MIME format. Additionally,\nany quoted-printable words in the value are decoded.",4,{"inputs":[{"name":"mailheader"}],"output":{"name":"result"}}],[11,"get_first_value","collections::vec","",5,{"inputs":[{"name":"vec"},{"name":"str"}],"output":{"name":"result"}}],[11,"get_first_value_ci","","",5,{"inputs":[{"name":"vec"},{"name":"str"}],"output":{"name":"result"}}],[11,"get_all_values","","",5,{"inputs":[{"name":"vec"},{"name":"str"}],"output":{"name":"result"}}],[11,"get_all_values_ci","","",5,{"inputs":[{"name":"vec"},{"name":"str"}],"output":{"name":"result"}}],[11,"fmt","mailparse","",0,{"inputs":[{"name":"parsedcontenttype"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",1,{"inputs":[{"name":"parsedmail"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"get_body","","Get the body of the message as a Rust string. This function tries to\nunapply the Content-Transfer-Encoding if there is one, and then converts\nthe result into a Rust UTF-8 string using the charset in the Content-Type\n(or "us-ascii" if the charset was missing or not recognized).",1,{"inputs":[{"name":"parsedmail"}],"output":{"name":"result"}}]],"paths":[[3,"ParsedContentType"],[3,"ParsedMail"],[4,"MailParseError"],[8,"MailHeaderMap"],[3,"MailHeader"],[3,"Vec"]]}; +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,"dateparse","","Convert a date field from an email header into a UNIX epoch timestamp.\nThis function handles the most common formatting of date fields found in\nemail headers. It may fail to parse some of the more creative formattings.",null,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[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-value pair.",null,null],[5,"parse_headers","","Parses all the headers from the raw data given.\nThis function takes raw byte data, and starts parsing it, expecting there\nto be zero or more MIME header key-value pair right at the beginning,\nfollowed by two consecutive newlines (i.e. a blank line). It parses those\nheaders and returns them in a vector. The normal vector functions can be\nused to access the headers linearly, or the MailHeaderMap trait can be used\nto access them in a map-like fashion. Along with this vector, the function\nreturns the index at which the message body is expected to start. If you\njust care about the headers, you can ignore the second component of the\nreturned tuple.\nError values are returned if there was some sort of parsing error.",null,null],[5,"parse_content_type","","Helper method to parse a header value as a Content-Type header. The charset\ndefaults to "us-ascii" if no charset parameter is provided in the header\nvalue.",null,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[5,"parse_mail","","The main mail-parsing entry point.\nThis function takes the raw data making up the message body and returns a\nstructured version of it, which allows easily accessing the header and body\ninformation as needed.",null,null],[8,"MailHeaderMap","","A trait that is implemented by the Vec<MailHeader> returned by the parse_headers\nfunction. It provides a map-like interface to look up header values by their\nname.",null,null],[10,"get_first_value","","Look through the list of headers and return the value of the first one\nthat matches the provided key. It returns Ok(None) if the no matching\nheader was found. Header names are matched case-insensitively.",3,{"inputs":[{"name":"mailheadermap"},{"name":"str"}],"output":{"name":"result"}}],[10,"get_all_values","","Look through the list of headers and return the values of all headers\nmatching the provided key. Returns an empty vector if no matching headers\nwere found. The order of the returned values is the same as the order\nof the matching headers in the message. Header names are matched\ncase-insensitively.",3,{"inputs":[{"name":"mailheadermap"},{"name":"str"}],"output":{"name":"result"}}],[11,"fmt","","",2,{"inputs":[{"name":"mailparseerror"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",2,{"inputs":[{"name":"mailparseerror"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"description","","",2,{"inputs":[{"name":"mailparseerror"}],"output":{"name":"str"}}],[11,"cause","","",2,{"inputs":[{"name":"mailparseerror"}],"output":{"name":"option"}}],[11,"from","","",2,{"inputs":[{"name":"quotedprintableerror"}],"output":{"name":"mailparseerror"}}],[11,"from","","",2,{"inputs":[{"name":"base64error"}],"output":{"name":"mailparseerror"}}],[11,"from","","",2,{"inputs":[{"name":"cow"}],"output":{"name":"mailparseerror"}}],[11,"fmt","","",4,{"inputs":[{"name":"mailheader"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"get_key","","Get the name of the header. Note that header names are case-insensitive.",4,{"inputs":[{"name":"mailheader"}],"output":{"name":"result"}}],[11,"get_value","","Get the value of the header. Any sequences of newlines characters followed\nby whitespace are collapsed into a single space. In effect, header values\nwrapped across multiple lines are compacted back into one line, while\ndiscarding the extra whitespace required by the MIME format. Additionally,\nany quoted-printable words in the value are decoded.",4,{"inputs":[{"name":"mailheader"}],"output":{"name":"result"}}],[11,"get_first_value","collections::vec","",5,{"inputs":[{"name":"vec"},{"name":"str"}],"output":{"name":"result"}}],[11,"get_all_values","","",5,{"inputs":[{"name":"vec"},{"name":"str"}],"output":{"name":"result"}}],[11,"fmt","mailparse","",0,{"inputs":[{"name":"parsedcontenttype"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",1,{"inputs":[{"name":"parsedmail"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"get_body","","Get the body of the message as a Rust string. This function tries to\nunapply the Content-Transfer-Encoding if there is one, and then converts\nthe result into a Rust UTF-8 string using the charset in the Content-Type\n(or "us-ascii" if the charset was missing or not recognized).",1,{"inputs":[{"name":"parsedmail"}],"output":{"name":"result"}}]],"paths":[[3,"ParsedContentType"],[3,"ParsedMail"],[4,"MailParseError"],[8,"MailHeaderMap"],[3,"MailHeader"],[3,"Vec"]]}; initSearch(searchIndex); diff --git a/target/doc/src/mailparse/src/lib.rs.html b/target/doc/src/mailparse/src/lib.rs.html index 4cc09f8..313765d 100644 --- a/target/doc/src/mailparse/src/lib.rs.html +++ b/target/doc/src/mailparse/src/lib.rs.html @@ -991,34 +991,6 @@ 947 948 949 -950 -951 -952 -953 -954 -955 -956 -957 -958 -959 -960 -961 -962 -963 -964 -965 -966 -967 -968 -969 -970 -971 -972 -973 -974 -975 -976 -977
 extern crate base64;
 extern crate encoding;
@@ -1166,7 +1138,7 @@
 }
 
 impl<'a> MailHeader<'a> {
-    /// Get the name of the header. Note that header names are case-sensitive.
+    /// Get the name of the header. Note that header names are case-insensitive.
     pub fn get_key(&self) -> Result<String, MailParseError> {
         Ok(try!(encoding::all::ISO_8859_1.decode(self.key, encoding::DecoderTrap::Strict))
             .trim()
@@ -1386,7 +1358,7 @@
 pub trait MailHeaderMap {
     /// Look through the list of headers and return the value of the first one
     /// that matches the provided key. It returns Ok(None) if the no matching
-    /// header was found.
+    /// header was found. Header names are matched case-insensitively.
     ///
     /// # Examples
     /// ```
@@ -1400,15 +1372,11 @@
     /// ```
     fn get_first_value(&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_first_value_ci(&self, key: &str) -> Result<Option<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
-    /// of the matching headers in the message.
+    /// of the matching headers in the message. Header names are matched
+    /// case-insensitively.
     ///
     /// # Examples
     /// ```
@@ -1421,24 +1389,10 @@
     ///         vec!["Value1".to_string(), "Value2".to_string()]);
     /// ```
     fn get_all_values(&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.
-    fn get_all_values_ci(&self, key: &str) -> Result<Vec<String>, MailParseError>;
 }
 
 impl<'a> MailHeaderMap for Vec<MailHeader<'a>> {
     fn get_first_value(&self, key: &str) -> Result<Option<String>, MailParseError> {
-        for x in self {
-            if try!(x.get_key()) == key {
-                return x.get_value().map(|v| Some(v));
-            }
-        }
-        Ok(None)
-    }
-
-    fn get_first_value_ci(&self, key: &str) -> Result<Option<String>, MailParseError> {
         let lower_key = key.to_lowercase();
         for x in self {
             if try!(x.get_key()).to_lowercase() == lower_key {
@@ -1449,16 +1403,6 @@
     }
 
     fn get_all_values(&self, key: &str) -> Result<Vec<String>, MailParseError> {
-        let mut values: Vec<String> = Vec::new();
-        for x in self {
-            if try!(x.get_key()) == key {
-                values.push(try!(x.get_value()));
-            }
-        }
-        Ok(values</