summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKartikaya Gupta <kats@trevize.staktrace.com>2018-09-05 20:57:47 -0400
committerKartikaya Gupta <kats@trevize.staktrace.com>2018-09-05 20:57:47 -0400
commit6ed59567fc1862c02005eaf80b0d3c4821c2815b (patch)
tree55cf252421476de147c2e4340331d3fa9afbd536
parent96808caf7d15cb73da84dc1bf8796fbe7136693e (diff)
downloadmailparse-6ed59567fc1862c02005eaf80b0d3c4821c2815b.tar.gz
mailparse-6ed59567fc1862c02005eaf80b0d3c4821c2815b.tar.xz
Remove documentation stuff; point to docs.rs
-rw-r--r--Cargo.toml2
-rw-r--r--README.md4
-rwxr-xr-xtarget/doc/.lock0
-rw-r--r--target/doc/COPYRIGHT.txt59
-rw-r--r--target/doc/FiraSans-LICENSE.txt99
-rw-r--r--target/doc/FiraSans-Medium.woffbin89883 -> 0 bytes
-rw-r--r--target/doc/FiraSans-Regular.woffbin91946 -> 0 bytes
-rw-r--r--target/doc/Heuristica-Italic.woffbin119956 -> 0 bytes
-rw-r--r--target/doc/Heuristica-LICENSE.txt101
-rw-r--r--target/doc/LICENSE-APACHE.txt201
-rw-r--r--target/doc/LICENSE-MIT.txt23
-rw-r--r--target/doc/SourceCodePro-LICENSE.txt93
-rw-r--r--target/doc/SourceCodePro-Regular.woffbin55472 -> 0 bytes
-rw-r--r--target/doc/SourceCodePro-Semibold.woffbin55360 -> 0 bytes
-rw-r--r--target/doc/SourceSerifPro-Bold.woffbin48720 -> 0 bytes
-rw-r--r--target/doc/SourceSerifPro-LICENSE.txt93
-rw-r--r--target/doc/SourceSerifPro-Regular.woffbin49960 -> 0 bytes
-rw-r--r--target/doc/brush.svg1
-rw-r--r--target/doc/dark.css391
-rw-r--r--target/doc/implementors/core/clone/trait.Clone.js10
-rw-r--r--target/doc/implementors/core/cmp/trait.PartialEq.js10
-rw-r--r--target/doc/implementors/core/convert/trait.From.js10
-rw-r--r--target/doc/implementors/core/default/trait.Default.js10
-rw-r--r--target/doc/implementors/core/fmt/trait.Debug.js10
-rw-r--r--target/doc/implementors/core/fmt/trait.Display.js10
-rw-r--r--target/doc/implementors/core/marker/trait.Send.js10
-rw-r--r--target/doc/implementors/core/marker/trait.Sync.js10
-rw-r--r--target/doc/implementors/mailparse/trait.MailHeaderMap.js10
-rw-r--r--target/doc/implementors/std/error/trait.Error.js10
-rw-r--r--target/doc/light.css385
-rw-r--r--target/doc/mailparse/DispositionType.t.html10
-rw-r--r--target/doc/mailparse/MailHeader.t.html10
-rw-r--r--target/doc/mailparse/MailHeaderMap.t.html10
-rw-r--r--target/doc/mailparse/MailParseError.t.html10
-rw-r--r--target/doc/mailparse/ParsedContentDisposition.t.html10
-rw-r--r--target/doc/mailparse/ParsedContentType.t.html10
-rw-r--r--target/doc/mailparse/ParsedMail.t.html10
-rw-r--r--target/doc/mailparse/dateparse.v.html10
-rw-r--r--target/doc/mailparse/dateparse/dateparse.v.html10
-rw-r--r--target/doc/mailparse/dateparse/fn.dateparse.html10
-rw-r--r--target/doc/mailparse/enum.DispositionType.html160
-rw-r--r--target/doc/mailparse/enum.MailParseError.html160
-rw-r--r--target/doc/mailparse/fn.dateparse.html133
-rw-r--r--target/doc/mailparse/fn.parse_content_disposition.html139
-rw-r--r--target/doc/mailparse/fn.parse_content_type.html160
-rw-r--r--target/doc/mailparse/fn.parse_header.html144
-rw-r--r--target/doc/mailparse/fn.parse_headers.html147
-rw-r--r--target/doc/mailparse/fn.parse_mail.html161
-rw-r--r--target/doc/mailparse/index.html280
-rw-r--r--target/doc/mailparse/parse_content_disposition.v.html10
-rw-r--r--target/doc/mailparse/parse_content_type.v.html10
-rw-r--r--target/doc/mailparse/parse_header.v.html10
-rw-r--r--target/doc/mailparse/parse_headers.v.html10
-rw-r--r--target/doc/mailparse/parse_mail.v.html10
-rw-r--r--target/doc/mailparse/sidebar-items.js1
-rw-r--r--target/doc/mailparse/struct.MailHeader.html158
-rw-r--r--target/doc/mailparse/struct.ParsedContentDisposition.html158
-rw-r--r--target/doc/mailparse/struct.ParsedContentType.html164
-rw-r--r--target/doc/mailparse/struct.ParsedMail.html197
-rw-r--r--target/doc/mailparse/trait.MailHeaderMap.html174
-rw-r--r--target/doc/main.css237
-rw-r--r--target/doc/main.js2045
-rw-r--r--target/doc/normalize.css1
-rw-r--r--target/doc/rustdoc.css1293
-rw-r--r--target/doc/search-index.js3
-rw-r--r--target/doc/src/mailparse/dateparse.rs.html544
-rw-r--r--target/doc/src/mailparse/lib.rs.html2576
-rw-r--r--target/doc/src/mailparse/macros.rs.html140
-rw-r--r--target/doc/storage.js71
-rw-r--r--target/doc/theme.js21
70 files changed, 3 insertions, 10966 deletions
diff --git a/Cargo.toml b/Cargo.toml
index a6fb80c..7ed35b2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -3,7 +3,7 @@ name = "mailparse"
version = "0.6.2"
authors = ["Kartikaya Gupta <kats@seldon.staktrace.com>"]
description = "A simple parser for MIME e-mail messages"
-documentation = "https://staktrace.github.io/mailparse/target/doc/mailparse/"
+documentation = "https://docs.rs/mailparse/"
homepage = "https://github.com/staktrace/mailparse/blob/master/README.md"
repository = "https://github.com/staktrace/mailparse"
readme = "README.md"
diff --git a/README.md b/README.md
index 2eabe64..c69b50d 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@ The primary entry point for this library is the following function:
```
This function takes the raw message data, including headers and body, and returns a structured object to more easily access pieces of the email message.
-There are other public functions that allow parsing smaller parts of the message as well; refer to the [full documentation](http://staktrace.github.io/mailparse/target/doc/mailparse/).
+There are other public functions that allow parsing smaller parts of the message as well; refer to the [full documentation](https://docs.rs/mailparse/).
The library is designed to process real-world email data such as might be obtained by using the FETCH command on an IMAP server, or in a Maildir.
As such, this library should successfully handle any valid MIME-formatted message, although it may not follow all the strict requirements in the various specifications that cover the format (predominantly IETF RFC 822 and IETF RFC 2045).
@@ -55,7 +55,7 @@ Example usage
Documentation
---
-See the rustdoc at [http://staktrace.github.io/mailparse/target/doc/mailparse/](http://staktrace.github.io/mailparse/target/doc/mailparse/).
+See the rustdoc at [https://docs.rs/mailparse/](docs.rs).
Other notes
---
diff --git a/target/doc/.lock b/target/doc/.lock
deleted file mode 100755
index e69de29..0000000
--- a/target/doc/.lock
+++ /dev/null
diff --git a/target/doc/COPYRIGHT.txt b/target/doc/COPYRIGHT.txt
deleted file mode 100644
index c69861a..0000000
--- a/target/doc/COPYRIGHT.txt
+++ /dev/null
@@ -1,59 +0,0 @@
-These documentation pages include resources by third parties. This copyright
-file applies only to those resources. The following third party resources are
-included, and carry their own copyright notices and license terms:
-
-* Fira Sans (FiraSans-Regular.woff, FiraSans-Medium.woff):
-
- Copyright (c) 2014, Mozilla Foundation https://mozilla.org/
- with Reserved Font Name Fira Sans.
-
- Copyright (c) 2014, Telefonica S.A.
-
- Licensed under the SIL Open Font License, Version 1.1.
- See FiraSans-LICENSE.txt.
-
-* Heuristica (Heuristica-Italic.woff):
-
- Copyright 1989, 1991 Adobe Systems Incorporated. All rights reserved.
- Utopia is either a registered trademark or trademark of Adobe Systems
- Incorporated in the United States and/or other countries. Used under
- license.
-
- Copyright 2006 Han The Thanh, Vntopia font family, http://vntex.sf.net
-
- Copyright (c) 2008-2012, Andrey V. Panov (panov@canopus.iacp.dvo.ru),
- with Reserved Font Name Heuristica.
-
- Licensed under the SIL Open Font License, Version 1.1.
- See Heuristica-LICENSE.txt.
-
-* rustdoc.css, main.js, and playpen.js:
-
- Copyright 2015 The Rust Developers.
- Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or
- the MIT license (LICENSE-MIT.txt) at your option.
-
-* normalize.css:
-
- Copyright (c) Nicolas Gallagher and Jonathan Neal.
- Licensed under the MIT license (see LICENSE-MIT.txt).
-
-* Source Code Pro (SourceCodePro-Regular.woff, SourceCodePro-Semibold.woff):
-
- Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
- with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark
- of Adobe Systems Incorporated in the United States and/or other countries.
-
- Licensed under the SIL Open Font License, Version 1.1.
- See SourceCodePro-LICENSE.txt.
-
-* Source Serif Pro (SourceSerifPro-Regular.woff, SourceSerifPro-Bold.woff):
-
- Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/), with
- Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of
- Adobe Systems Incorporated in the United States and/or other countries.
-
- Licensed under the SIL Open Font License, Version 1.1.
- See SourceSerifPro-LICENSE.txt.
-
-This copyright file is intended to be distributed with rustdoc output.
diff --git a/target/doc/FiraSans-LICENSE.txt b/target/doc/FiraSans-LICENSE.txt
deleted file mode 100644
index b4a3967..0000000
--- a/target/doc/FiraSans-LICENSE.txt
+++ /dev/null
@@ -1,99 +0,0 @@
-Copyright (c) 2014, Mozilla Foundation https://mozilla.org/
-with Reserved Font Name Fira Sans.
-
-Copyright (c) 2014, Mozilla Foundation https://mozilla.org/
-with Reserved Font Name Fira Mono.
-
-Copyright (c) 2014, Telefonica S.A.
-
-This Font Software is licensed under the SIL Open Font License, Version 1.1.
-This license is copied below, and is also available with a FAQ at:
-http://scripts.sil.org/OFL
-
-
------------------------------------------------------------
-SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
------------------------------------------------------------
-
-PREAMBLE
-The goals of the Open Font License (OFL) are to stimulate worldwide
-development of collaborative font projects, to support the font creation
-efforts of academic and linguistic communities, and to provide a free and
-open framework in which fonts may be shared and improved in partnership
-with others.
-
-The OFL allows the licensed fonts to be used, studied, modified and
-redistributed freely as long as they are not sold by themselves. The
-fonts, including any derivative works, can be bundled, embedded,
-redistributed and/or sold with any software provided that any reserved
-names are not used by derivative works. The fonts and derivatives,
-however, cannot be released under any other type of license. The
-requirement for fonts to remain under this license does not apply
-to any document created using the fonts or their derivatives.
-
-DEFINITIONS
-"Font Software" refers to the set of files released by the Copyright
-Holder(s) under this license and clearly marked as such. This may
-include source files, build scripts and documentation.
-
-"Reserved Font Name" refers to any names specified as such after the
-copyright statement(s).
-
-"Original Version" refers to the collection of Font Software components as
-distributed by the Copyright Holder(s).
-
-"Modified Version" refers to any derivative made by adding to, deleting,
-or substituting -- in part or in whole -- any of the components of the
-Original Version, by changing formats or by porting the Font Software to a
-new environment.
-
-"Author" refers to any designer, engineer, programmer, technical
-writer or other person who contributed to the Font Software.
-
-PERMISSION & CONDITIONS
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of the Font Software, to use, study, copy, merge, embed, modify,
-redistribute, and sell modified and unmodified copies of the Font
-Software, subject to the following conditions:
-
-1) Neither the Font Software nor any of its individual components,
-in Original or Modified Versions, may be sold by itself.
-
-2) Original or Modified Versions of the Font Software may be bundled,
-redistributed and/or sold with any software, provided that each copy
-contains the above copyright notice and this license. These can be
-included either as stand-alone text files, human-readable headers or
-in the appropriate machine-readable metadata fields within text or
-binary files as long as those fields can be easily viewed by the user.
-
-3) No Modified Version of the Font Software may use the Reserved Font
-Name(s) unless explicit written permission is granted by the corresponding
-Copyright Holder. This restriction only applies to the primary font name as
-presented to the users.
-
-4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
-Software shall not be used to promote, endorse or advertise any
-Modified Version, except to acknowledge the contribution(s) of the
-Copyright Holder(s) and the Author(s) or with their explicit written
-permission.
-
-5) The Font Software, modified or unmodified, in part or in whole,
-must be distributed entirely under this license, and must not be
-distributed under any other license. The requirement for fonts to
-remain under this license does not apply to any document created
-using the Font Software.
-
-TERMINATION
-This license becomes null and void if any of the above conditions are
-not met.
-
-DISCLAIMER
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
-OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/target/doc/FiraSans-Medium.woff b/target/doc/FiraSans-Medium.woff
deleted file mode 100644
index 5627227..0000000
--- a/target/doc/FiraSans-Medium.woff
+++ /dev/null
Binary files differ
diff --git a/target/doc/FiraSans-Regular.woff b/target/doc/FiraSans-Regular.woff
deleted file mode 100644
index 9ff4044..0000000
--- a/target/doc/FiraSans-Regular.woff
+++ /dev/null
Binary files differ
diff --git a/target/doc/Heuristica-Italic.woff b/target/doc/Heuristica-Italic.woff
deleted file mode 100644
index b0cebf0..0000000
--- a/target/doc/Heuristica-Italic.woff
+++ /dev/null
Binary files differ
diff --git a/target/doc/Heuristica-LICENSE.txt b/target/doc/Heuristica-LICENSE.txt
deleted file mode 100644
index dd85e40..0000000
--- a/target/doc/Heuristica-LICENSE.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-Copyright 1989, 1991 Adobe Systems Incorporated. All rights reserved.
-Utopia is either a registered trademark or trademark of Adobe Systems
-Incorporated in the United States and/or other countries. Used under
-license.
-
-Copyright 2006 Han The Thanh, Vntopia font family, http://vntex.sf.net
-
-Copyright (c) 2008-2012, Andrey V. Panov (panov@canopus.iacp.dvo.ru),
-with Reserved Font Name Heuristica.
-
-This Font Software is licensed under the SIL Open Font License, Version 1.1.
-This license is copied below, and is also available with a FAQ at:
-http://scripts.sil.org/OFL
-
-
------------------------------------------------------------
-SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
------------------------------------------------------------
-
-PREAMBLE
-The goals of the Open Font License (OFL) are to stimulate worldwide
-development of collaborative font projects, to support the font creation
-efforts of academic and linguistic communities, and to provide a free and
-open framework in which fonts may be shared and improved in partnership
-with others.
-
-The OFL allows the licensed fonts to be used, studied, modified and
-redistributed freely as long as they are not sold by themselves. The
-fonts, including any derivative works, can be bundled, embedded,
-redistributed and/or sold with any software provided that any reserved
-names are not used by derivative works. The fonts and derivatives,
-however, cannot be released under any other type of license. The
-requirement for fonts to remain under this license does not apply
-to any document created using the fonts or their derivatives.
-
-DEFINITIONS
-"Font Software" refers to the set of files released by the Copyright
-Holder(s) under this license and clearly marked as such. This may
-include source files, build scripts and documentation.
-
-"Reserved Font Name" refers to any names specified as such after the
-copyright statement(s).
-
-"Original Version" refers to the collection of Font Software components as
-distributed by the Copyright Holder(s).
-
-"Modified Version" refers to any derivative made by adding to, deleting,
-or substituting -- in part or in whole -- any of the components of the
-Original Version, by changing formats or by porting the Font Software to a
-new environment.
-
-"Author" refers to any designer, engineer, programmer, technical
-writer or other person who contributed to the Font Software.
-
-PERMISSION & CONDITIONS
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of the Font Software, to use, study, copy, merge, embed, modify,
-redistribute, and sell modified and unmodified copies of the Font
-Software, subject to the following conditions:
-
-1) Neither the Font Software nor any of its individual components,
-in Original or Modified Versions, may be sold by itself.
-
-2) Original or Modified Versions of the Font Software may be bundled,
-redistributed and/or sold with any software, provided that each copy
-contains the above copyright notice and this license. These can be
-included either as stand-alone text files, human-readable headers or
-in the appropriate machine-readable metadata fields within text or
-binary files as long as those fields can be easily viewed by the user.
-
-3) No Modified Version of the Font Software may use the Reserved Font
-Name(s) unless explicit written permission is granted by the corresponding
-Copyright Holder. This restriction only applies to the primary font name as
-presented to the users.
-
-4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
-Software shall not be used to promote, endorse or advertise any
-Modified Version, except to acknowledge the contribution(s) of the
-Copyright Holder(s) and the Author(s) or with their explicit written
-permission.
-
-5) The Font Software, modified or unmodified, in part or in whole,
-must be distributed entirely under this license, and must not be
-distributed under any other license. The requirement for fonts to
-remain under this license does not apply to any document created
-using the Font Software.
-
-TERMINATION
-This license becomes null and void if any of the above conditions are
-not met.
-
-DISCLAIMER
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
-OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/target/doc/LICENSE-APACHE.txt b/target/doc/LICENSE-APACHE.txt
deleted file mode 100644
index 16fe87b..0000000
--- a/target/doc/LICENSE-APACHE.txt
+++ /dev/null
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
-Copyright [yyyy] [name of copyright owner]
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
diff --git a/target/doc/LICENSE-MIT.txt b/target/doc/LICENSE-MIT.txt
deleted file mode 100644
index 31aa793..0000000
--- a/target/doc/LICENSE-MIT.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Permission is hereby granted, free of charge, to any
-person obtaining a copy of this software and associated
-documentation files (the "Software"), to deal in the
-Software without restriction, including without
-limitation the rights to use, copy, modify, merge,
-publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software
-is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice
-shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
-ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
diff --git a/target/doc/SourceCodePro-LICENSE.txt b/target/doc/SourceCodePro-LICENSE.txt
deleted file mode 100644
index 0754257..0000000
--- a/target/doc/SourceCodePro-LICENSE.txt
+++ /dev/null
@@ -1,93 +0,0 @@
-Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
-
-This Font Software is licensed under the SIL Open Font License, Version 1.1.
-
-This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-
-
------------------------------------------------------------
-SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
------------------------------------------------------------
-
-PREAMBLE
-The goals of the Open Font License (OFL) are to stimulate worldwide
-development of collaborative font projects, to support the font creation
-efforts of academic and linguistic communities, and to provide a free and
-open framework in which fonts may be shared and improved in partnership
-with others.
-
-The OFL allows the licensed fonts to be used, studied, modified and
-redistributed freely as long as they are not sold by themselves. The
-fonts, including any derivative works, can be bundled, embedded,
-redistributed and/or sold with any software provided that any reserved
-names are not used by derivative works. The fonts and derivatives,
-however, cannot be released under any other type of license. The
-requirement for fonts to remain under this license does not apply
-to any document created using the fonts or their derivatives.
-
-DEFINITIONS
-"Font Software" refers to the set of files released by the Copyright
-Holder(s) under this license and clearly marked as such. This may
-include source files, build scripts and documentation.
-
-"Reserved Font Name" refers to any names specified as such after the
-copyright statement(s).
-
-"Original Version" refers to the collection of Font Software components as
-distributed by the Copyright Holder(s).
-
-"Modified Version" refers to any derivative made by adding to, deleting,
-or substituting -- in part or in whole -- any of the components of the
-Original Version, by changing formats or by porting the Font Software to a
-new environment.
-
-"Author" refers to any designer, engineer, programmer, technical
-writer or other person who contributed to the Font Software.
-
-PERMISSION & CONDITIONS
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of the Font Software, to use, study, copy, merge, embed, modify,
-redistribute, and sell modified and unmodified copies of the Font
-Software, subject to the following conditions:
-
-1) Neither the Font Software nor any of its individual components,
-in Original or Modified Versions, may be sold by itself.
-
-2) Original or Modified Versions of the Font Software may be bundled,
-redistributed and/or sold with any software, provided that each copy
-contains the above copyright notice and this license. These can be
-included either as stand-alone text files, human-readable headers or
-in the appropriate machine-readable metadata fields within text or
-binary files as long as those fields can be easily viewed by the user.
-
-3) No Modified Version of the Font Software may use the Reserved Font
-Name(s) unless explicit written permission is granted by the corresponding
-Copyright Holder. This restriction only applies to the primary font name as
-presented to the users.
-
-4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
-Software shall not be used to promote, endorse or advertise any
-Modified Version, except to acknowledge the contribution(s) of the
-Copyright Holder(s) and the Author(s) or with their explicit written
-permission.
-
-5) The Font Software, modified or unmodified, in part or in whole,
-must be distributed entirely under this license, and must not be
-distributed under any other license. The requirement for fonts to
-remain under this license does not apply to any document created
-using the Font Software.
-
-TERMINATION
-This license becomes null and void if any of the above conditions are
-not met.
-
-DISCLAIMER
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
-OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/target/doc/SourceCodePro-Regular.woff b/target/doc/SourceCodePro-Regular.woff
deleted file mode 100644
index 5576670..0000000
--- a/target/doc/SourceCodePro-Regular.woff
+++ /dev/null
Binary files differ
diff --git a/target/doc/SourceCodePro-Semibold.woff b/target/doc/SourceCodePro-Semibold.woff
deleted file mode 100644
index ca972a1..0000000
--- a/target/doc/SourceCodePro-Semibold.woff
+++ /dev/null
Binary files differ
diff --git a/target/doc/SourceSerifPro-Bold.woff b/target/doc/SourceSerifPro-Bold.woff
deleted file mode 100644
index ac1b1b3..0000000
--- a/target/doc/SourceSerifPro-Bold.woff
+++ /dev/null
Binary files differ
diff --git a/target/doc/SourceSerifPro-LICENSE.txt b/target/doc/SourceSerifPro-LICENSE.txt
deleted file mode 100644
index b77d653..0000000
--- a/target/doc/SourceSerifPro-LICENSE.txt
+++ /dev/null
@@ -1,93 +0,0 @@
-Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
-
-This Font Software is licensed under the SIL Open Font License, Version 1.1.
-
-This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-
-
------------------------------------------------------------
-SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
------------------------------------------------------------
-
-PREAMBLE
-The goals of the Open Font License (OFL) are to stimulate worldwide
-development of collaborative font projects, to support the font creation
-efforts of academic and linguistic communities, and to provide a free and
-open framework in which fonts may be shared and improved in partnership
-with others.
-
-The OFL allows the licensed fonts to be used, studied, modified and
-redistributed freely as long as they are not sold by themselves. The
-fonts, including any derivative works, can be bundled, embedded,
-redistributed and/or sold with any software provided that any reserved
-names are not used by derivative works. The fonts and derivatives,
-however, cannot be released under any other type of license. The
-requirement for fonts to remain under this license does not apply
-to any document created using the fonts or their derivatives.
-
-DEFINITIONS
-"Font Software" refers to the set of files released by the Copyright
-Holder(s) under this license and clearly marked as such. This may
-include source files, build scripts and documentation.
-
-"Reserved Font Name" refers to any names specified as such after the
-copyright statement(s).
-
-"Original Version" refers to the collection of Font Software components as
-distributed by the Copyright Holder(s).
-
-"Modified Version" refers to any derivative made by adding to, deleting,
-or substituting -- in part or in whole -- any of the components of the
-Original Version, by changing formats or by porting the Font Software to a
-new environment.
-
-"Author" refers to any designer, engineer, programmer, technical
-writer or other person who contributed to the Font Software.
-
-PERMISSION & CONDITIONS
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of the Font Software, to use, study, copy, merge, embed, modify,
-redistribute, and sell modified and unmodified copies of the Font
-Software, subject to the following conditions:
-
-1) Neither the Font Software nor any of its individual components,
-in Original or Modified Versions, may be sold by itself.
-
-2) Original or Modified Versions of the Font Software may be bundled,
-redistributed and/or sold with any software, provided that each copy
-contains the above copyright notice and this license. These can be
-included either as stand-alone text files, human-readable headers or
-in the appropriate machine-readable metadata fields within text or
-binary files as long as those fields can be easily viewed by the user.
-
-3) No Modified Version of the Font Software may use the Reserved Font
-Name(s) unless explicit written permission is granted by the corresponding
-Copyright Holder. This restriction only applies to the primary font name as
-presented to the users.
-
-4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
-Software shall not be used to promote, endorse or advertise any
-Modified Version, except to acknowledge the contribution(s) of the
-Copyright Holder(s) and the Author(s) or with their explicit written
-permission.
-
-5) The Font Software, modified or unmodified, in part or in whole,
-must be distributed entirely under this license, and must not be
-distributed under any other license. The requirement for fonts to
-remain under this license does not apply to any document created
-using the Font Software.
-
-TERMINATION
-This license becomes null and void if any of the above conditions are
-not met.
-
-DISCLAIMER
-THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
-DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
-OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/target/doc/SourceSerifPro-Regular.woff b/target/doc/SourceSerifPro-Regular.woff
deleted file mode 100644
index e8c43b8..0000000
--- a/target/doc/SourceSerifPro-Regular.woff
+++ /dev/null
Binary files differ
diff --git a/target/doc/brush.svg b/target/doc/brush.svg
deleted file mode 100644
index 072264a..0000000
--- a/target/doc/brush.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" ?><svg height="1792" viewBox="0 0 1792 1792" width="1792" xmlns="http://www.w3.org/2000/svg"><path d="M1615 0q70 0 122.5 46.5t52.5 116.5q0 63-45 151-332 629-465 752-97 91-218 91-126 0-216.5-92.5t-90.5-219.5q0-128 92-212l638-579q59-54 130-54zm-909 1034q39 76 106.5 130t150.5 76l1 71q4 213-129.5 347t-348.5 134q-123 0-218-46.5t-152.5-127.5-86.5-183-29-220q7 5 41 30t62 44.5 59 36.5 46 17q41 0 55-37 25-66 57.5-112.5t69.5-76 88-47.5 103-25.5 125-10.5z"/></svg> \ No newline at end of file
diff --git a/target/doc/dark.css b/target/doc/dark.css
deleted file mode 100644
index 2d0fe55..0000000
--- a/target/doc/dark.css
+++ /dev/null
@@ -1,391 +0,0 @@
-/**
- * Copyright 2015 The Rust Project Developers. See the COPYRIGHT
- * file at the top-level directory of this distribution and at
- * http://rust-lang.org/COPYRIGHT.
- *
- * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
- * http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
- * <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
- * option. This file may not be copied, modified, or distributed
- * except according to those terms.
- */
-
-body {
- background-color: #353535;
- color: #ddd;
-}
-
-h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
- color: #ddd;
-}
-h1.fqn {
- border-bottom-color: #d2d2d2;
-}
-h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
- border-bottom-color: #d2d2d2;
-}
-
-.in-band {
- background-color: #353535;
-}
-
-.invisible {
- background: rgba(0, 0, 0, 0);
-}
-
-.docblock code, .docblock-short code {
- background-color: #2A2A2A;
-}
-pre {
- background-color: #2A2A2A;
-}
-
-.sidebar {
- background-color: #505050;
-}
-
-.sidebar .current {
- background-color: #333;
-}
-
-.source .sidebar {
- background-color: #353535;
-}
-
-.sidebar .location {
- border-color: #fff;
- background: #575757;
- color: #DDD;
-}
-
-.sidebar .version {
- border-bottom-color: #DDD;
-}
-
-.sidebar-title {
- border-top-color: #777;
- border-bottom-color: #777;
-}
-
-.block a:hover {
- background: #444;
-}
-
-.line-numbers span { color: #3B91E2; }
-.line-numbers .line-highlighted {
- background-color: #0a042f !important;
-}
-
-.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
- border-bottom-color: #DDD;
-}
-
-.docblock table {
- border-color: #ddd;
-}
-
-.docblock table td {
- border-top-color: #ddd;
- border-bottom-color: #ddd;
-}
-
-.docblock table th {
- border-top-color: #ddd;
- border-bottom-color: #ddd;
-}
-
-:target { background: #494a3d; }
-
-:target > .in-band {
- background: #494a3d;
-}
-
-.content .method .where,
-.content .fn .where,
-.content .where.fmt-newline {
- color: #ddd;
-}
-
-.content .highlighted {
- color: #eee !important;
- background-color: #333;
-}
-.content .highlighted a, .content .highlighted span { color: #eee !important; }
-.content .highlighted.trait { background-color: #013191; }
-.content .highlighted.mod,
-.content .highlighted.externcrate { background-color: #afc6e4; }
-.content .highlighted.mod { background-color: #803a1b; }
-.content .highlighted.externcrate { background-color: #396bac; }
-.content .highlighted.enum { background-color: #5b4e68; }
-.content .highlighted.struct { background-color: #194e9f; }
-.content .highlighted.union { background-color: #b7bd49; }
-.content .highlighted.fn,
-.content .highlighted.method,
-.content .highlighted.tymethod { background-color: #4950ed; }
-.content .highlighted.type { background-color: #38902c; }
-.content .highlighted.foreigntype { background-color: #b200d6; }
-.content .highlighted.macro { background-color: #217d1c; }
-.content .highlighted.constant,
-.content .highlighted.static { background-color: #0063cc; }
-.content .highlighted.primitive { background-color: #00708a; }
-
-.content span.enum, .content a.enum, .block a.current.enum { color: #82b089; }
-.content span.struct, .content a.struct, .block a.current.struct { color: #2dbfb8; }
-.content span.type, .content a.type, .block a.current.type { color: #ff7f00; }
-.content span.foreigntype, .content a.foreigntype, .block a.current.foreigntype { color: #dd7de8; }
-.content span.macro, .content a.macro, .block a.current.macro { color: #09bd00; }
-.content span.union, .content a.union, .block a.current.union { color: #a6ae37; }
-.content span.constant, .content a.constant, .block a.current.constant,
-.content span.static, .content a.static, .block a.current.static { color: #82a5c9; }
-.content span.primitive, .content a.primitive, .block a.current.primitive { color: #43aec7; }
-.content span.externcrate,
-.content span.mod, .content a.mod, .block a.current.mod { color: #bda000; }
-.content span.trait, .content a.trait, .block a.current.trait { color: #b78cf2; }
-.content span.fn, .content a.fn, .block a.current.fn,
-.content span.method, .content a.method, .block a.current.method,
-.content span.tymethod, .content a.tymethod, .block a.current.tymethod,
-.content .fnname{ color: #2BAB63; }
-
-pre.rust .comment { color: #8d8d8b; }
-pre.rust .doccomment { color: #8ca375; }
-
-nav {
- border-bottom-color: #4e4e4e;
-}
-nav.main .current {
- border-top-color: #eee;
- border-bottom-color: #eee;
-}
-nav.main .separator {
- border-color: #eee;
-}
-a {
- color: #ddd;
-}
-
-.docblock a, .docblock-short a, .stability a {
- color: #D2991D;
-}
-
-a.test-arrow {
- color: #dedede;
-}
-
-.collapse-toggle {
- color: #999;
-}
-
-.search-input {
- color: #111;
- box-shadow: 0 0 0 1px #000, 0 0 0 2px transparent;
- background-color: #f0f0f0;
-}
-
-.search-input:focus {
- border-color: #008dfd;
-}
-
-.stab.unstable { background: #FFF5D6; border-color: #FFC600; color: #404040; }
-.stab.deprecated { background: #F3DFFF; border-color: #7F0087; color: #404040; }
-.stab.portability { background: #C4ECFF; border-color: #7BA5DB; color: #404040; }
-
-.module-item .stab {
- color: #ddd;
-}
-
-#help > div {
- background: #4d4d4d;
- border-color: #bfbfbf;
-}
-
-#help dt {
- border-color: #bfbfbf;
- background: rgba(0,0,0,0);
- color: black;
-}
-
-.since {
- color: grey;
-}
-
-tr.result span.primitive::after {
- color: #ddd;
-}
-
-.line-numbers :target { background-color: transparent; }
-
-/* Code highlighting */
-pre.rust .kw { color: #ab8ac1; }
-pre.rust .kw-2, pre.rust .prelude-ty { color: #769acb; }
-pre.rust .number, pre.rust .string { color: #83a300; }
-pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val,
-pre.rust .attribute, pre.rust .attribute .ident { color: #ee6868; }
-pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
-pre.rust .lifetime { color: #d97f26; }
-pre.rust .question-mark {
- color: #ff9011;
-}
-
-a.test-arrow {
- background-color: rgba(78, 139, 202, 0.2);
-}
-
-a.test-arrow:hover{
- background-color: #4e8bca;
-}
-
-.toggle-label {
- color: #999;
-}
-
-:target > code {
- background: #FDFFD3;
-}
-
-pre.compile_fail {
- border-left: 2px solid rgba(255,0,0,.6);
-}
-
-pre.compile_fail:hover, .information:hover + pre.compile_fail {
- border-left: 2px solid #f00;
-}
-
-pre.ignore {
- border-left: 2px solid rgba(255,142,0,.6);
-}
-
-pre.ignore:hover, .information:hover + pre.ignore {
- border-left: 2px solid #ff9200;
-}
-
-.tooltip.compile_fail {
- color: rgba(255,0,0,.6);
-}
-
-.information > .compile_fail:hover {
- color: #f00;
-}
-
-.tooltip.ignore {
- color: rgba(255,142,0,.6);
-}
-
-.information > .ignore:hover {
- color: rgba(255,142,0,1);
-}
-
-.search-failed > a {
- color: #0089ff;
-}
-
-.tooltip .tooltiptext {
- background-color: black;
- color: #fff;
-}
-
-.tooltip .tooltiptext::after {
- border-color: transparent black transparent transparent;
-}
-
-.important-traits .tooltip .tooltiptext {
- background-color: white;
- color: black;
- border-color: black;
-}
-
-#titles > div {
- border-bottom-color: #ccc;
-}
-
-#titles > div.selected {
- border-bottom-color: #0078ee;
-}
-
-#titles > div:hover {
- border-bottom-color: #0089ff;
-}
-
-#titles > div > div.count {
- color: #888;
-}
-
-.modal {
- background-color: rgba(0,0,0,0.3);
-}
-
-.modal-content {
- background-color: #272727;
- border-color: #999;
-}
-
-.modal-content > .close {
- background-color: #272727;
- border-color: #999;
-}
-
-.modal-content > .close:hover {
- background-color: #ff1f1f;
- color: white;
-}
-
-.modal-content > .whiter {
- background-color: #272727;
-}
-
-.modal-content > .close:hover + .whiter {
- background-color: #ff1f1f;
-}
-
-@media (max-width: 700px) {
- .sidebar-menu {
- background-color: #505050;
- border-bottom-color: #e0e0e0;
- border-right-color: #e0e0e0;
- }
-
- .sidebar-elems {
- background-color: #505050;
- border-right-color: #000;
- }
-
- #sidebar-filler {
- background-color: #505050;
- border-bottom-color: #e0e0e0;
- }
-}
-
-kbd {
- color: #000;
- background-color: #fafbfc;
- border-color: #d1d5da;
- border-bottom-color: #c6cbd1;
- box-shadow-color: #c6cbd1;
-}
-
-#theme-picker {
- border-color: #e0e0e0;
- background: #f0f0f0;
-}
-
-#theme-picker:hover, #theme-picker:focus {
- border-color: #ffb900;
-}
-
-#theme-choices {
- border-color: #e0e0e0;
- background-color: #353535;
-}
-
-#theme-choices > button:not(:first-child) {
- border-top-color: #e0e0e0;
-}
-
-#theme-choices > button:hover, #theme-choices > button:focus {
- background-color: #444;
-}
-
-@media (max-width: 700px) {
- #theme-picker {
- background: #f0f0f0;
- }
-}
diff --git a/target/doc/implementors/core/clone/trait.Clone.js b/target/doc/implementors/core/clone/trait.Clone.js
deleted file mode 100644
index 65833bb..0000000
--- a/target/doc/implementors/core/clone/trait.Clone.js
+++ /dev/null
@@ -1,10 +0,0 @@
-(function() {var implementors = {};
-implementors["mailparse"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"mailparse/enum.DispositionType.html\" title=\"enum mailparse::DispositionType\">DispositionType</a>",synthetic:false,types:["mailparse::DispositionType"]},];
-
- if (window.register_implementors) {
- window.register_implementors(implementors);
- } else {
- window.pending_implementors = implementors;
- }
-
-})()
diff --git a/target/doc/implementors/core/cmp/trait.PartialEq.js b/target/doc/implementors/core/cmp/trait.PartialEq.js
deleted file mode 100644
index 1f977ce..0000000
--- a/target/doc/implementors/core/cmp/trait.PartialEq.js
+++ /dev/null
@@ -1,10 +0,0 @@
-(function() {var implementors = {};
-implementors["mailparse"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html\" title=\"trait core::cmp::PartialEq\">PartialEq</a> for <a class=\"enum\" href=\"mailparse/enum.DispositionType.html\" title=\"enum mailparse::DispositionType\">DispositionType</a>",synthetic:false,types:["mailparse::DispositionType"]},];
-
- if (window.register_implementors) {
- window.register_implementors(implementors);
- } else {
- window.pending_implementors = implementors;
- }
-
-})()
diff --git a/target/doc/implementors/core/convert/trait.From.js b/target/doc/implementors/core/convert/trait.From.js
deleted file mode 100644
index bca3ba2..0000000
--- a/target/doc/implementors/core/convert/trait.From.js
+++ /dev/null
@@ -1,10 +0,0 @@
-(function() {var implementors = {};
-implementors["mailparse"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;QuotedPrintableError&gt; for <a class=\"enum\" href=\"mailparse/enum.MailParseError.html\" title=\"enum mailparse::MailParseError\">MailParseError</a>",synthetic:false,types:["mailparse::MailParseError"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;DecodeError&gt; for <a class=\"enum\" href=\"mailparse/enum.MailParseError.html\" title=\"enum mailparse::MailParseError\">MailParseError</a>",synthetic:false,types:["mailparse::MailParseError"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/convert/trait.From.html\" title=\"trait core::convert::From\">From</a>&lt;<a class=\"enum\" href=\"https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html\" title=\"enum alloc::borrow::Cow\">Cow</a>&lt;'static, <a class=\"primitive\" href=\"https://doc.rust-lang.org/nightly/std/primitive.str.html\">str</a>&gt;&gt; for <a class=\"enum\" href=\"mailparse/enum.MailParseError.html\" title=\"enum mailparse::MailParseError\">MailParseError</a>",synthetic:false,types:["mailparse::MailParseError"]},];
-
- if (window.register_implementors) {
- window.register_implementors(implementors);
- } else {
- window.pending_implementors = implementors;
- }
-
-})()
diff --git a/target/doc/implementors/core/default/trait.Default.js b/target/doc/implementors/core/default/trait.Default.js
deleted file mode 100644
index 137415b..0000000
--- a/target/doc/implementors/core/default/trait.Default.js
+++ /dev/null
@@ -1,10 +0,0 @@
-(function() {var implementors = {};
-implementors["mailparse"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"mailparse/struct.ParsedContentType.html\" title=\"struct mailparse::ParsedContentType\">ParsedContentType</a>",synthetic:false,types:["mailparse::ParsedContentType"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"enum\" href=\"mailparse/enum.DispositionType.html\" title=\"enum mailparse::DispositionType\">DispositionType</a>",synthetic:false,types:["mailparse::DispositionType"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/default/trait.Default.html\" title=\"trait core::default::Default\">Default</a> for <a class=\"struct\" href=\"mailparse/struct.ParsedContentDisposition.html\" title=\"struct mailparse::ParsedContentDisposition\">ParsedContentDisposition</a>",synthetic:false,types:["mailparse::ParsedContentDisposition"]},];
-
- if (window.register_implementors) {
- window.register_implementors(implementors);
- } else {
- window.pending_implementors = implementors;
- }
-
-})()
diff --git a/target/doc/implementors/core/fmt/trait.Debug.js b/target/doc/implementors/core/fmt/trait.Debug.js
deleted file mode 100644
index b882da5..0000000
--- a/target/doc/implementors/core/fmt/trait.Debug.js
+++ /dev/null
@@ -1,10 +0,0 @@
-(function() {var implementors = {};
-implementors["mailparse"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"mailparse/enum.MailParseError.html\" title=\"enum mailparse::MailParseError\">MailParseError</a>",synthetic:false,types:["mailparse::MailParseError"]},{text:"impl&lt;'a&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"mailparse/struct.MailHeader.html\" title=\"struct mailparse::MailHeader\">MailHeader</a>&lt;'a&gt;",synthetic:false,types:["mailparse::MailHeader"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"mailparse/struct.ParsedContentType.html\" title=\"struct mailparse::ParsedContentType\">ParsedContentType</a>",synthetic:false,types:["mailparse::ParsedContentType"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"mailparse/enum.DispositionType.html\" title=\"enum mailparse::DispositionType\">DispositionType</a>",synthetic:false,types:["mailparse::DispositionType"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"mailparse/struct.ParsedContentDisposition.html\" title=\"struct mailparse::ParsedContentDisposition\">ParsedContentDisposition</a>",synthetic:false,types:["mailparse::ParsedContentDisposition"]},{text:"impl&lt;'a&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"mailparse/struct.ParsedMail.html\" title=\"struct mailparse::ParsedMail\">ParsedMail</a>&lt;'a&gt;",synthetic:false,types:["mailparse::ParsedMail"]},];
-
- if (window.register_implementors) {
- window.register_implementors(implementors);
- } else {
- window.pending_implementors = implementors;
- }
-
-})()
diff --git a/target/doc/implementors/core/fmt/trait.Display.js b/target/doc/implementors/core/fmt/trait.Display.js
deleted file mode 100644
index 93eafd2..0000000
--- a/target/doc/implementors/core/fmt/trait.Display.js
+++ /dev/null
@@ -1,10 +0,0 @@
-(function() {var implementors = {};
-implementors["mailparse"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html\" title=\"trait core::fmt::Display\">Display</a> for <a class=\"enum\" href=\"mailparse/enum.MailParseError.html\" title=\"enum mailparse::MailParseError\">MailParseError</a>",synthetic:false,types:["mailparse::MailParseError"]},];
-
- if (window.register_implementors) {
- window.register_implementors(implementors);
- } else {
- window.pending_implementors = implementors;
- }
-
-})()
diff --git a/target/doc/implementors/core/marker/trait.Send.js b/target/doc/implementors/core/marker/trait.Send.js
deleted file mode 100644
index d22816b..0000000
--- a/target/doc/implementors/core/marker/trait.Send.js
+++ /dev/null
@@ -1,10 +0,0 @@
-(function() {var implementors = {};
-implementors["mailparse"] = [{text:"impl&lt;'a&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"mailparse/struct.MailHeader.html\" title=\"struct mailparse::MailHeader\">MailHeader</a>&lt;'a&gt;",synthetic:true,types:["mailparse::MailHeader"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"mailparse/struct.ParsedContentType.html\" title=\"struct mailparse::ParsedContentType\">ParsedContentType</a>",synthetic:true,types:["mailparse::ParsedContentType"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"mailparse/struct.ParsedContentDisposition.html\" title=\"struct mailparse::ParsedContentDisposition\">ParsedContentDisposition</a>",synthetic:true,types:["mailparse::ParsedContentDisposition"]},{text:"impl&lt;'a&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"struct\" href=\"mailparse/struct.ParsedMail.html\" title=\"struct mailparse::ParsedMail\">ParsedMail</a>&lt;'a&gt;",synthetic:true,types:["mailparse::ParsedMail"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"mailparse/enum.MailParseError.html\" title=\"enum mailparse::MailParseError\">MailParseError</a>",synthetic:true,types:["mailparse::MailParseError"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Send.html\" title=\"trait core::marker::Send\">Send</a> for <a class=\"enum\" href=\"mailparse/enum.DispositionType.html\" title=\"enum mailparse::DispositionType\">DispositionType</a>",synthetic:true,types:["mailparse::DispositionType"]},];
-
- if (window.register_implementors) {
- window.register_implementors(implementors);
- } else {
- window.pending_implementors = implementors;
- }
-
-})()
diff --git a/target/doc/implementors/core/marker/trait.Sync.js b/target/doc/implementors/core/marker/trait.Sync.js
deleted file mode 100644
index 7feae7c..0000000
--- a/target/doc/implementors/core/marker/trait.Sync.js
+++ /dev/null
@@ -1,10 +0,0 @@
-(function() {var implementors = {};
-implementors["mailparse"] = [{text:"impl&lt;'a&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"mailparse/struct.MailHeader.html\" title=\"struct mailparse::MailHeader\">MailHeader</a>&lt;'a&gt;",synthetic:true,types:["mailparse::MailHeader"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"mailparse/struct.ParsedContentType.html\" title=\"struct mailparse::ParsedContentType\">ParsedContentType</a>",synthetic:true,types:["mailparse::ParsedContentType"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"mailparse/struct.ParsedContentDisposition.html\" title=\"struct mailparse::ParsedContentDisposition\">ParsedContentDisposition</a>",synthetic:true,types:["mailparse::ParsedContentDisposition"]},{text:"impl&lt;'a&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"struct\" href=\"mailparse/struct.ParsedMail.html\" title=\"struct mailparse::ParsedMail\">ParsedMail</a>&lt;'a&gt;",synthetic:true,types:["mailparse::ParsedMail"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"mailparse/enum.MailParseError.html\" title=\"enum mailparse::MailParseError\">MailParseError</a>",synthetic:true,types:["mailparse::MailParseError"]},{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html\" title=\"trait core::marker::Sync\">Sync</a> for <a class=\"enum\" href=\"mailparse/enum.DispositionType.html\" title=\"enum mailparse::DispositionType\">DispositionType</a>",synthetic:true,types:["mailparse::DispositionType"]},];
-
- if (window.register_implementors) {
- window.register_implementors(implementors);
- } else {
- window.pending_implementors = implementors;
- }
-
-})()
diff --git a/target/doc/implementors/mailparse/trait.MailHeaderMap.js b/target/doc/implementors/mailparse/trait.MailHeaderMap.js
deleted file mode 100644
index d137575..0000000
--- a/target/doc/implementors/mailparse/trait.MailHeaderMap.js
+++ /dev/null
@@ -1,10 +0,0 @@
-(function() {var implementors = {};
-implementors["mailparse"] = [];
-
- if (window.register_implementors) {
- window.register_implementors(implementors);
- } else {
- window.pending_implementors = implementors;
- }
-
-})()
diff --git a/target/doc/implementors/std/error/trait.Error.js b/target/doc/implementors/std/error/trait.Error.js
deleted file mode 100644
index e24314d..0000000
--- a/target/doc/implementors/std/error/trait.Error.js
+++ /dev/null
@@ -1,10 +0,0 @@
-(function() {var implementors = {};
-implementors["mailparse"] = [{text:"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/std/error/trait.Error.html\" title=\"trait std::error::Error\">Error</a> for <a class=\"enum\" href=\"mailparse/enum.MailParseError.html\" title=\"enum mailparse::MailParseError\">MailParseError</a>",synthetic:false,types:["mailparse::MailParseError"]},];
-
- if (window.register_implementors) {
- window.register_implementors(implementors);
- } else {
- window.pending_implementors = implementors;
- }
-
-})()
diff --git a/target/doc/light.css b/target/doc/light.css
deleted file mode 100644
index 2334a27..0000000
--- a/target/doc/light.css
+++ /dev/null
@@ -1,385 +0,0 @@
-/**
- * Copyright 2015 The Rust Project Developers. See the COPYRIGHT
- * file at the top-level directory of this distribution and at
- * http://rust-lang.org/COPYRIGHT.
- *
- * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
- * http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
- * <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
- * option. This file may not be copied, modified, or distributed
- * except according to those terms.
- */
-
-/* General structure and fonts */
-
-body {
- background-color: white;
- color: black;
-}
-
-h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
- color: black;
-}
-h1.fqn {
- border-bottom-color: #D5D5D5;
-}
-h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
- border-bottom-color: #DDDDDD;
-}
-
-.in-band {
- background-color: white;
-}
-
-.invisible {
- background: rgba(0, 0, 0, 0);
-}
-
-.docblock code, .docblock-short code {
- background-color: #F5F5F5;
-}
-pre {
- background-color: #F5F5F5;
-}
-
-.sidebar {
- background-color: #F1F1F1;
-}
-
-.sidebar .current {
- background-color: #fff;
-}
-
-.source .sidebar {
- background-color: #fff;
-}
-
-.sidebar .location {
- border-color: #000;
- background-color: #fff;
- color: #333;
-}
-
-.sidebar .version {
- border-bottom-color: #DDD;
-}
-
-.sidebar-title {
- border-top-color: #777;
- border-bottom-color: #777;
-}
-
-.block a:hover {
- background: #F5F5F5;
-}
-
-.line-numbers span { color: #c67e2d; }
-.line-numbers .line-highlighted {
- background-color: #f6fdb0 !important;
-}
-
-.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
- border-bottom-color: #DDD;
-}
-
-.docblock table {
- border-color: #ddd;
-}
-
-.docblock table td {
- border-top-color: #ddd;
- border-bottom-color: #ddd;
-}
-
-.docblock table th {
- border-top-color: #ddd;
- border-bottom-color: #ddd;
-}
-
-:target { background: #FDFFD3; }
-
-:target > .in-band {
- background: #FDFFD3;
-}
-
-.content .method .where,
-.content .fn .where,
-.content .where.fmt-newline {
- color: #4E4C4C;
-}
-
-.content .highlighted {
- color: #000 !important;
- background-color: #ccc;
-}
-.content .highlighted a, .content .highlighted span { color: #000 !important; }
-.content .highlighted.trait { background-color: #c7b6ff; }
-.content .highlighted.mod,
-.content .highlighted.externcrate { background-color: #afc6e4; }
-.content .highlighted.enum { background-color: #b4d1b9; }
-.content .highlighted.struct { background-color: #e7b1a0; }
-.content .highlighted.union { background-color: #b7bd49; }
-.content .highlighted.fn,
-.content .highlighted.method,
-.content .highlighted.tymethod { background-color: #c6afb3; }
-.content .highlighted.type { background-color: #ffc891; }
-.content .highlighted.foreigntype { background-color: #f5c4ff; }
-.content .highlighted.macro { background-color: #8ce488; }
-.content .highlighted.constant,
-.content .highlighted.static { background-color: #c3e0ff; }
-.content .highlighted.primitive { background-color: #9aecff; }
-
-.content span.enum, .content a.enum, .block a.current.enum { color: #508157; }
-.content span.struct, .content a.struct, .block a.current.struct { color: #ad448e; }
-.content span.type, .content a.type, .block a.current.type { color: #ba5d00; }
-.content span.foreigntype, .content a.foreigntype, .block a.current.foreigntype { color: #cd00e2; }
-.content span.macro, .content a.macro, .block a.current.macro { color: #068000; }
-.content span.union, .content a.union, .block a.current.union { color: #767b27; }
-.content span.constant, .content a.constant, .block a.current.constant,
-.content span.static, .content a.static, .block a.current.static { color: #546e8a; }
-.content span.primitive, .content a.primitive, .block a.current.primitive { color: #2c8093; }
-.content span.externcrate,
-.content span.mod, .content a.mod, .block a.current.mod { color: #4d76ae; }
-.content span.trait, .content a.trait, .block a.current.trait { color: #7c5af3; }
-.content span.fn, .content a.fn, .block a.current.fn,
-.content span.method, .content a.method, .block a.current.method,
-.content span.tymethod, .content a.tymethod, .block a.current.tymethod,
-.content .fnname { color: #9a6e31; }
-
-pre.rust .comment { color: #8E908C; }
-pre.rust .doccomment { color: #4D4D4C; }
-
-nav {
- border-bottom-color: #e0e0e0;
-}
-nav.main .current {
- border-top-color: #000;
- border-bottom-color: #000;
-}
-nav.main .separator {
- border: 1px solid #000;
-}
-a {
- color: #000;
-}
-
-.docblock a, .docblock-short a, .stability a {
- color: #3873AD;
-}
-
-a.test-arrow {
- color: #f5f5f5;
-}
-
-.collapse-toggle {
- color: #999;
-}
-
-.search-input {
- color: #555;
- box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent;
- background-color: white;
-}
-
-.search-input:focus {
- border-color: #66afe9;
-}
-
-.stab.unstable { background: #FFF5D6; border-color: #FFC600; }
-.stab.deprecated { background: #F3DFFF; border-color: #7F0087; }
-.stab.portability { background: #C4ECFF; border-color: #7BA5DB; }
-
-.module-item .stab {
- color: #000;
-}
-
-#help > div {
- background: #e9e9e9;
- border-color: #bfbfbf;
-}
-
-.since {
- color: grey;
-}
-
-tr.result span.primitive::after {
- color: black;
-}
-
-.line-numbers :target { background-color: transparent; }
-
-/* Code highlighting */
-pre.rust .kw { color: #8959A8; }
-pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
-pre.rust .number, pre.rust .string { color: #718C00; }
-pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val,
-pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
-pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
-pre.rust .lifetime { color: #B76514; }
-pre.rust .question-mark {
- color: #ff9011;
-}
-
-a.test-arrow {
- background-color: rgba(78, 139, 202, 0.2);
-}
-
-a.test-arrow:hover{
- background-color: #4e8bca;
-}
-
-.toggle-label {
- color: #999;
-}
-
-:target > code {
- background: #FDFFD3;
-}
-
-pre.compile_fail {
- border-left: 2px solid rgba(255,0,0,.4);
-}
-
-pre.compile_fail:hover, .information:hover + pre.compile_fail {
- border-left: 2px solid #f00;
-}
-
-pre.ignore {
- border-left: 2px solid rgba(255,142,0,.4);
-}
-
-pre.ignore:hover, .information:hover + pre.ignore {
- border-left: 2px solid #ff9200;
-}
-
-.tooltip.compile_fail {
- color: rgba(255,0,0,.3);
-}
-
-.information > .compile_fail:hover {
- color: #f00;
-}
-
-.tooltip.ignore {
- color: rgba(255,142,0,.3);
-}
-
-.information > .ignore:hover {
- color: rgba(255,142,0,1);
-}
-
-.search-failed > a {
- color: #0089ff;
-}
-
-.tooltip .tooltiptext {
- background-color: black;
- color: #fff;
-}
-
-.tooltip .tooltiptext::after {
- border-color: transparent black transparent transparent;
-}
-
-.important-traits .tooltip .tooltiptext {
- background-color: white;
- color: black;
- border-color: black;
-}
-
-#titles > div {
- border-bottom-color: #ccc;
-}
-
-#titles > div.selected {
- border-bottom-color: #0078ee;
-}
-
-#titles > div:hover {
- border-bottom-color: #0089ff;
-}
-
-#titles > div > div.count {
- color: #888;
-}
-
-.modal {
- background-color: rgba(0,0,0,0.3);
-}
-
-.modal-content {
- background-color: #eee;
- border-color: #999;
-}
-
-.modal-content > .close {
- background-color: #eee;
- border-color: #999;
-}
-
-.modal-content > .close:hover {
- background-color: #ff1f1f;
- color: white;
-}
-
-.modal-content > .whiter {
- background-color: #eee;
-}
-
-.modal-content > .close:hover + .whiter {
- background-color: #ff1f1f;
-}
-
-@media (max-width: 700px) {
- .sidebar-menu {
- background-color: #F1F1F1;
- border-bottom-color: #e0e0e0;
- border-right-color: #e0e0e0;
- }
-
- .sidebar-elems {
- background-color: #F1F1F1;
- border-right-color: #000;
- }
-
- #sidebar-filler {
- background-color: #F1F1F1;
- border-bottom-color: #e0e0e0;
- }
-}
-
-kbd {
- color: #000;
- background-color: #fafbfc;
- border-color: #d1d5da;
- border-bottom-color: #c6cbd1;
- box-shadow-color: #c6cbd1;
-}
-
-#theme-picker {
- border-color: #e0e0e0;
- background-color: #fff;
-}
-
-#theme-picker:hover, #theme-picker:focus {
- border-color: #717171;
-}
-
-#theme-choices {
- border-color: #ccc;
- background-color: #fff;
-}
-
-#theme-choices > button:not(:first-child) {
- border-top-color: #e0e0e0;
-}
-
-#theme-choices > button:hover, #theme-choices > button:focus {
- background-color: #eee;
-}
-
-@media (max-width: 700px) {
- #theme-picker {
- background: #fff;
- }
-}
diff --git a/target/doc/mailparse/DispositionType.t.html b/target/doc/mailparse/DispositionType.t.html
deleted file mode 100644
index a7914f1..0000000
--- a/target/doc/mailparse/DispositionType.t.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=enum.DispositionType.html">
-</head>
-<body>
- <p>Redirecting to <a href="enum.DispositionType.html">enum.DispositionType.html</a>...</p>
- <script>location.replace("enum.DispositionType.html" + location.search + location.hash);</script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/MailHeader.t.html b/target/doc/mailparse/MailHeader.t.html
deleted file mode 100644
index 1d344a8..0000000
--- a/target/doc/mailparse/MailHeader.t.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=struct.MailHeader.html">
-</head>
-<body>
- <p>Redirecting to <a href="struct.MailHeader.html">struct.MailHeader.html</a>...</p>
- <script>location.replace("struct.MailHeader.html" + location.search + location.hash);</script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/MailHeaderMap.t.html b/target/doc/mailparse/MailHeaderMap.t.html
deleted file mode 100644
index 72171d6..0000000
--- a/target/doc/mailparse/MailHeaderMap.t.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=trait.MailHeaderMap.html">
-</head>
-<body>
- <p>Redirecting to <a href="trait.MailHeaderMap.html">trait.MailHeaderMap.html</a>...</p>
- <script>location.replace("trait.MailHeaderMap.html" + location.search + location.hash);</script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/MailParseError.t.html b/target/doc/mailparse/MailParseError.t.html
deleted file mode 100644
index f9f054d..0000000
--- a/target/doc/mailparse/MailParseError.t.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=enum.MailParseError.html">
-</head>
-<body>
- <p>Redirecting to <a href="enum.MailParseError.html">enum.MailParseError.html</a>...</p>
- <script>location.replace("enum.MailParseError.html" + location.search + location.hash);</script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/ParsedContentDisposition.t.html b/target/doc/mailparse/ParsedContentDisposition.t.html
deleted file mode 100644
index 2b5a540..0000000
--- a/target/doc/mailparse/ParsedContentDisposition.t.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=struct.ParsedContentDisposition.html">
-</head>
-<body>
- <p>Redirecting to <a href="struct.ParsedContentDisposition.html">struct.ParsedContentDisposition.html</a>...</p>
- <script>location.replace("struct.ParsedContentDisposition.html" + location.search + location.hash);</script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/ParsedContentType.t.html b/target/doc/mailparse/ParsedContentType.t.html
deleted file mode 100644
index 2948f99..0000000
--- a/target/doc/mailparse/ParsedContentType.t.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=struct.ParsedContentType.html">
-</head>
-<body>
- <p>Redirecting to <a href="struct.ParsedContentType.html">struct.ParsedContentType.html</a>...</p>
- <script>location.replace("struct.ParsedContentType.html" + location.search + location.hash);</script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/ParsedMail.t.html b/target/doc/mailparse/ParsedMail.t.html
deleted file mode 100644
index f02e5af..0000000
--- a/target/doc/mailparse/ParsedMail.t.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=struct.ParsedMail.html">
-</head>
-<body>
- <p>Redirecting to <a href="struct.ParsedMail.html">struct.ParsedMail.html</a>...</p>
- <script>location.replace("struct.ParsedMail.html" + location.search + location.hash);</script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/dateparse.v.html b/target/doc/mailparse/dateparse.v.html
deleted file mode 100644
index b3daddf..0000000
--- a/target/doc/mailparse/dateparse.v.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=fn.dateparse.html">
-</head>
-<body>
- <p>Redirecting to <a href="fn.dateparse.html">fn.dateparse.html</a>...</p>
- <script>location.replace("fn.dateparse.html" + location.search + location.hash);</script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/dateparse/dateparse.v.html b/target/doc/mailparse/dateparse/dateparse.v.html
deleted file mode 100644
index b3daddf..0000000
--- a/target/doc/mailparse/dateparse/dateparse.v.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=fn.dateparse.html">
-</head>
-<body>
- <p>Redirecting to <a href="fn.dateparse.html">fn.dateparse.html</a>...</p>
- <script>location.replace("fn.dateparse.html" + location.search + location.hash);</script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/dateparse/fn.dateparse.html b/target/doc/mailparse/dateparse/fn.dateparse.html
deleted file mode 100644
index 672efd7..0000000
--- a/target/doc/mailparse/dateparse/fn.dateparse.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=../../mailparse/fn.dateparse.html">
-</head>
-<body>
- <p>Redirecting to <a href="../../mailparse/fn.dateparse.html">../../mailparse/fn.dateparse.html</a>...</p>
- <script>location.replace("../../mailparse/fn.dateparse.html" + location.search + location.hash);</script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/enum.DispositionType.html b/target/doc/mailparse/enum.DispositionType.html
deleted file mode 100644
index 6d59150..0000000
--- a/target/doc/mailparse/enum.DispositionType.html
+++ /dev/null
@@ -1,160 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="generator" content="rustdoc">
- <meta name="description" content="API documentation for the Rust `DispositionType` enum in crate `mailparse`.">
- <meta name="keywords" content="rust, rustlang, rust-lang, DispositionType">
-
- <title>mailparse::DispositionType - Rust</title>
-
- <link rel="stylesheet" type="text/css" href="../normalize.css">
- <link rel="stylesheet" type="text/css" href="../rustdoc.css"
- id="mainThemeStyle">
-
- <link rel="stylesheet" type="text/css" href="../dark.css">
- <link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle">
- <script src="../storage.js"></script>
-
-
-
-
-</head>
-<body class="rustdoc enum">
- <!--[if lte IE 8]>
- <div class="warning">
- This old browser is unsupported and will most likely display funky
- things.
- </div>
- <![endif]-->
-
-
-
- <nav class="sidebar">
- <div class="sidebar-menu">&#9776;</div>
-
- <p class='location'>Enum DispositionType</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.Inline">Inline</a><a href="#variant.Attachment">Attachment</a><a href="#variant.FormData">FormData</a><a href="#variant.Extension">Extension</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Clone">Clone</a><a href="#impl-PartialEq">PartialEq</a><a href="#impl-Default">Default</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='index.html'>mailparse</a></p><script>window.sidebarCurrent = {name: 'DispositionType', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
- </nav>
-
- <div class="theme-picker">
- <button id="theme-picker" aria-label="Pick another theme!">
- <img src="../brush.svg" width="18" alt="Pick another theme!">
- </button>
- <div id="theme-choices"></div>
- </div>
- <script src="../theme.js"></script>
- <nav class="sub">
- <form class="search-form js-only">
- <div class="search-container">
- <input class="search-input" name="search"
- autocomplete="off"
- placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
- type="search">
- </div>
- </form>
- </nav>
-
- <section id='main' class="content"><h1 class='fqn'><span class='in-band'>Enum <a href='index.html'>mailparse</a>::<wbr><a class="enum" href=''>DispositionType</a></span><span class='out-of-band'><span id='render-detail'>
- <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
- [<span class='inner'>&#x2212;</span>]
- </a>
- </span><a class='srclink' href='../src/mailparse/lib.rs.html#574-585' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust enum'>pub enum DispositionType {
- Inline,
- Attachment,
- FormData,
- Extension(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>),
-}</pre></div><div class='docblock'><p>The possible disposition types in a Content-Disposition header. A more
-comprehensive list of IANA-recognized types can be found at
-https://www.iana.org/assignments/cont-disp/cont-disp.xhtml. This library
-only enumerates the types most commonly found in email messages, and
-provides the <code>Extension</code> value for holding all other types.</p>
-</div><h2 id='variants' class='variants small-section-header'>
- Variants<a href='#variants' class='anchor'></a></h2>
-<span id="variant.Inline" class="variant small-section-header"><a href="#variant.Inline" class="anchor field"></a><span id='Inline.v' class='invisible'><code>Inline</code></span></span><div class='docblock'><p>Default value, indicating the content is to be displayed inline as
-part of the enclosing document.</p>
-</div><span id="variant.Attachment" class="variant small-section-header"><a href="#variant.Attachment" class="anchor field"></a><span id='Attachment.v' class='invisible'><code>Attachment</code></span></span><div class='docblock'><p>A disposition indicating the content is not meant for inline display,
-but whose content can be accessed for use.</p>
-</div><span id="variant.FormData" class="variant small-section-header"><a href="#variant.FormData" class="anchor field"></a><span id='FormData.v' class='invisible'><code>FormData</code></span></span><div class='docblock'><p>A disposition indicating the content contains a form submission.</p>
-</div><span id="variant.Extension" class="variant small-section-header"><a href="#variant.Extension" class="anchor field"></a><span id='Extension.v' class='invisible'><code>Extension(<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>)</code></span></span><div class='docblock'><p>Extension type to hold any disposition not explicitly enumerated.</p>
-</div>
- <h2 id='implementations' class='small-section-header'>
- Trait Implementations<a href='#implementations' class='anchor'></a>
- </h2>
- <div id='implementations-list'>
- <h3 id='impl-Debug' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../mailparse/enum.DispositionType.html" title="enum mailparse::DispositionType">DispositionType</a></code><a href='#impl-Debug' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#573' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#573' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Clone' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../mailparse/enum.DispositionType.html" title="enum mailparse::DispositionType">DispositionType</a></code><a href='#impl-Clone' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#573' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.clone' class="method"><span id='clone.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class="enum" href="../mailparse/enum.DispositionType.html" title="enum mailparse::DispositionType">DispositionType</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#573' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
-</div><h4 id='method.clone_from' class="method"><span id='clone_from.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</code></span></td><td><span class='out-of-band'><div class='ghost'></div><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div><a class='srclink' href='https://doc.rust-lang.org/nightly/src/core/clone.rs.html#117-119' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
-</div></div><h3 id='impl-PartialEq' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a> for <a class="enum" href="../mailparse/enum.DispositionType.html" title="enum mailparse::DispositionType">DispositionType</a></code><a href='#impl-PartialEq' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#573' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.eq' class="method"><span id='eq.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq' class='fnname'>eq</a>(&amp;self, __arg_0: &amp;<a class="enum" href="../mailparse/enum.DispositionType.html" title="enum mailparse::DispositionType">DispositionType</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#573' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
-</div><h4 id='method.ne' class="method"><span id='ne.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne' class='fnname'>ne</a>(&amp;self, __arg_0: &amp;<a class="enum" href="../mailparse/enum.DispositionType.html" title="enum mailparse::DispositionType">DispositionType</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#573' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>This method tests for <code>!=</code>.</p>
-</div></div><h3 id='impl-Default' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="enum" href="../mailparse/enum.DispositionType.html" title="enum mailparse::DispositionType">DispositionType</a></code><a href='#impl-Default' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#587-591' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.default' class="method"><span id='default.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -&gt; Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#588-590' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the &quot;default value&quot; for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
-</div></div></div>
- <h2 id='synthetic-implementations' class='small-section-header'>
- Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
- </h2>
- <div id='synthetic-implementations-list'>
- <h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../mailparse/enum.DispositionType.html" title="enum mailparse::DispositionType">DispositionType</a></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../mailparse/enum.DispositionType.html" title="enum mailparse::DispositionType">DispositionType</a></code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div></div></section>
- <section id='search' class="content hidden"></section>
-
- <section class="footer"></section>
-
- <aside id="help" class="hidden">
- <div>
- <h1 class="hidden">Help</h1>
-
- <div class="shortcuts">
- <h2>Keyboard Shortcuts</h2>
-
- <dl>
- <dt><kbd>?</kbd></dt>
- <dd>Show this help dialog</dd>
- <dt><kbd>S</kbd></dt>
- <dd>Focus the search field</dd>
- <dt><kbd>↑</kbd></dt>
- <dd>Move up in search results</dd>
- <dt><kbd>↓</kbd></dt>
- <dd>Move down in search results</dd>
- <dt><kbd>↹</kbd></dt>
- <dd>Switch tab</dd>
- <dt><kbd>&#9166;</kbd></dt>
- <dd>Go to active search result</dd>
- <dt><kbd>+</kbd></dt>
- <dd>Expand all sections</dd>
- <dt><kbd>-</kbd></dt>
- <dd>Collapse all sections</dd>
- </dl>
- </div>
-
- <div class="infos">
- <h2>Search Tricks</h2>
-
- <p>
- Prefix searches with a type followed by a colon (e.g.
- <code>fn:</code>) to restrict the search to a given type.
- </p>
-
- <p>
- Accepted types are: <code>fn</code>, <code>mod</code>,
- <code>struct</code>, <code>enum</code>,
- <code>trait</code>, <code>type</code>, <code>macro</code>,
- and <code>const</code>.
- </p>
-
- <p>
- Search functions by type signature (e.g.
- <code>vec -> usize</code> or <code>* -> vec</code>)
- </p>
- </div>
- </div>
- </aside>
-
-
-
- <script>
- window.rootPath = "../";
- window.currentCrate = "mailparse";
- </script>
- <script src="../main.js"></script>
- <script defer src="../search-index.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/enum.MailParseError.html b/target/doc/mailparse/enum.MailParseError.html
deleted file mode 100644
index 4e3c5c3..0000000
--- a/target/doc/mailparse/enum.MailParseError.html
+++ /dev/null
@@ -1,160 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="generator" content="rustdoc">
- <meta name="description" content="API documentation for the Rust `MailParseError` enum in crate `mailparse`.">
- <meta name="keywords" content="rust, rustlang, rust-lang, MailParseError">
-
- <title>mailparse::MailParseError - Rust</title>
-
- <link rel="stylesheet" type="text/css" href="../normalize.css">
- <link rel="stylesheet" type="text/css" href="../rustdoc.css"
- id="mainThemeStyle">
-
- <link rel="stylesheet" type="text/css" href="../dark.css">
- <link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle">
- <script src="../storage.js"></script>
-
-
-
-
-</head>
-<body class="rustdoc enum">
- <!--[if lte IE 8]>
- <div class="warning">
- This old browser is unsupported and will most likely display funky
- things.
- </div>
- <![endif]-->
-
-
-
- <nav class="sidebar">
- <div class="sidebar-menu">&#9776;</div>
-
- <p class='location'>Enum MailParseError</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#variants">Variants</a><div class="sidebar-links"><a href="#variant.QuotedPrintableDecodeError">QuotedPrintableDecodeError</a><a href="#variant.Base64DecodeError">Base64DecodeError</a><a href="#variant.EncodingError">EncodingError</a><a href="#variant.Generic">Generic</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Display">Display</a><a href="#impl-Error">Error</a><a href="#impl-From%3CQuotedPrintableError%3E">From&lt;QuotedPrintableError&gt;</a><a href="#impl-From%3CDecodeError%3E">From&lt;DecodeError&gt;</a><a href="#impl-From%3CCow%3C%27static%2C%20str%3E%3E">From&lt;Cow&lt;&#39;static, str&gt;&gt;</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='index.html'>mailparse</a></p><script>window.sidebarCurrent = {name: 'MailParseError', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
- </nav>
-
- <div class="theme-picker">
- <button id="theme-picker" aria-label="Pick another theme!">
- <img src="../brush.svg" width="18" alt="Pick another theme!">
- </button>
- <div id="theme-choices"></div>
- </div>
- <script src="../theme.js"></script>
- <nav class="sub">
- <form class="search-form js-only">
- <div class="search-container">
- <input class="search-input" name="search"
- autocomplete="off"
- placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
- type="search">
- </div>
- </form>
- </nav>
-
- <section id='main' class="content"><h1 class='fqn'><span class='in-band'>Enum <a href='index.html'>mailparse</a>::<wbr><a class="enum" href=''>MailParseError</a></span><span class='out-of-band'><span id='render-detail'>
- <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
- [<span class='inner'>&#x2212;</span>]
- </a>
- </span><a class='srclink' href='../src/mailparse/lib.rs.html#21-34' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust enum'>pub enum MailParseError {
- QuotedPrintableDecodeError(QuotedPrintableError),
- Base64DecodeError(DecodeError),
- EncodingError(<a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;),
- Generic(&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>),
-}</pre></div><div class='docblock'><p>An error type that represents the different kinds of errors that may be
-encountered during message parsing.</p>
-</div><h2 id='variants' class='variants small-section-header'>
- Variants<a href='#variants' class='anchor'></a></h2>
-<span id="variant.QuotedPrintableDecodeError" class="variant small-section-header"><a href="#variant.QuotedPrintableDecodeError" class="anchor field"></a><span id='QuotedPrintableDecodeError.v' class='invisible'><code>QuotedPrintableDecodeError(QuotedPrintableError)</code></span></span><div class='docblock'><p>Data that was specified as being in the quoted-printable transfer-encoding
-could not be successfully decoded as quoted-printable data.</p>
-</div><span id="variant.Base64DecodeError" class="variant small-section-header"><a href="#variant.Base64DecodeError" class="anchor field"></a><span id='Base64DecodeError.v' class='invisible'><code>Base64DecodeError(DecodeError)</code></span></span><div class='docblock'><p>Data that was specified as being in the base64 transfer-encoding could
-not be successfully decoded as base64 data.</p>
-</div><span id="variant.EncodingError" class="variant small-section-header"><a href="#variant.EncodingError" class="anchor field"></a><span id='EncodingError.v' class='invisible'><code>EncodingError(<a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;)</code></span></span><div class='docblock'><p>An error occurred when converting the raw byte data to Rust UTF-8 string
-format using the charset specified in the message.</p>
-</div><span id="variant.Generic" class="variant small-section-header"><a href="#variant.Generic" class="anchor field"></a><span id='Generic.v' class='invisible'><code>Generic(&amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>)</code></span></span><div class='docblock'><p>Some other error occurred while parsing the message; the description string
-provides additional details.</p>
-</div>
- <h2 id='implementations' class='small-section-header'>
- Trait Implementations<a href='#implementations' class='anchor'></a>
- </h2>
- <div id='implementations-list'>
- <h3 id='impl-Debug' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a></code><a href='#impl-Debug' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#20' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#20' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Display' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a> for <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a></code><a href='#impl-Display' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#36-47' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt-1' class="method"><span id='fmt.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#37-46' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Display.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Error' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a> for <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a></code><a href='#impl-Error' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#49-66' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.description' class="method"><span id='description.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#tymethod.description' class='fnname'>description</a>(&amp;self) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#50-57' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>A short description of the error. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#tymethod.description">Read more</a></p>
-</div><h4 id='method.cause' class="method"><span id='cause.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause' class='fnname'>cause</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;&amp;<a class="trait" href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html" title="trait std::error::Error">Error</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#59-65' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>The lower-level cause of this error, if any. <a href="https://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.cause">Read more</a></p>
-</div></div><h3 id='impl-From%3CQuotedPrintableError%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;QuotedPrintableError&gt; for <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a></code><a href='#impl-From%3CQuotedPrintableError%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#68-72' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.from' class="method"><span id='from.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: QuotedPrintableError) -&gt; <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#69-71' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CDecodeError%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;DecodeError&gt; for <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a></code><a href='#impl-From%3CDecodeError%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#74-78' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.from-1' class="method"><span id='from.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: DecodeError) -&gt; <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#75-77' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs the conversion.</p>
-</div></div><h3 id='impl-From%3CCow%3C%27static%2C%20str%3E%3E' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;&gt; for <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a></code><a href='#impl-From%3CCow%3C%27static%2C%20str%3E%3E' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#80-84' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.from-2' class="method"><span id='from.v-2' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from' class='fnname'>from</a>(err: <a class="enum" href="https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'static, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;) -&gt; <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#81-83' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Performs the conversion.</p>
-</div></div></div>
- <h2 id='synthetic-implementations' class='small-section-header'>
- Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
- </h2>
- <div id='synthetic-implementations-list'>
- <h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a></code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div></div></section>
- <section id='search' class="content hidden"></section>
-
- <section class="footer"></section>
-
- <aside id="help" class="hidden">
- <div>
- <h1 class="hidden">Help</h1>
-
- <div class="shortcuts">
- <h2>Keyboard Shortcuts</h2>
-
- <dl>
- <dt><kbd>?</kbd></dt>
- <dd>Show this help dialog</dd>
- <dt><kbd>S</kbd></dt>
- <dd>Focus the search field</dd>
- <dt><kbd>↑</kbd></dt>
- <dd>Move up in search results</dd>
- <dt><kbd>↓</kbd></dt>
- <dd>Move down in search results</dd>
- <dt><kbd>↹</kbd></dt>
- <dd>Switch tab</dd>
- <dt><kbd>&#9166;</kbd></dt>
- <dd>Go to active search result</dd>
- <dt><kbd>+</kbd></dt>
- <dd>Expand all sections</dd>
- <dt><kbd>-</kbd></dt>
- <dd>Collapse all sections</dd>
- </dl>
- </div>
-
- <div class="infos">
- <h2>Search Tricks</h2>
-
- <p>
- Prefix searches with a type followed by a colon (e.g.
- <code>fn:</code>) to restrict the search to a given type.
- </p>
-
- <p>
- Accepted types are: <code>fn</code>, <code>mod</code>,
- <code>struct</code>, <code>enum</code>,
- <code>trait</code>, <code>type</code>, <code>macro</code>,
- and <code>const</code>.
- </p>
-
- <p>
- Search functions by type signature (e.g.
- <code>vec -> usize</code> or <code>* -> vec</code>)
- </p>
- </div>
- </div>
- </aside>
-
-
-
- <script>
- window.rootPath = "../";
- window.currentCrate = "mailparse";
- </script>
- <script src="../main.js"></script>
- <script defer src="../search-index.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/fn.dateparse.html b/target/doc/mailparse/fn.dateparse.html
deleted file mode 100644
index 3c185cc..0000000
--- a/target/doc/mailparse/fn.dateparse.html
+++ /dev/null
@@ -1,133 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="generator" content="rustdoc">
- <meta name="description" content="API documentation for the Rust `dateparse` fn in crate `mailparse`.">
- <meta name="keywords" content="rust, rustlang, rust-lang, dateparse">
-
- <title>mailparse::dateparse - Rust</title>
-
- <link rel="stylesheet" type="text/css" href="../normalize.css">
- <link rel="stylesheet" type="text/css" href="../rustdoc.css"
- id="mainThemeStyle">
-
- <link rel="stylesheet" type="text/css" href="../dark.css">
- <link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle">
- <script src="../storage.js"></script>
-
-
-
-
-</head>
-<body class="rustdoc fn">
- <!--[if lte IE 8]>
- <div class="warning">
- This old browser is unsupported and will most likely display funky
- things.
- </div>
- <![endif]-->
-
-
-
- <nav class="sidebar">
- <div class="sidebar-menu">&#9776;</div>
-
- <div class="sidebar-elems"><p class='location'><a href='index.html'>mailparse</a></p><script>window.sidebarCurrent = {name: 'dateparse', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
- </nav>
-
- <div class="theme-picker">
- <button id="theme-picker" aria-label="Pick another theme!">
- <img src="../brush.svg" width="18" alt="Pick another theme!">
- </button>
- <div id="theme-choices"></div>
- </div>
- <script src="../theme.js"></script>
- <nav class="sub">
- <form class="search-form js-only">
- <div class="search-container">
- <input class="search-input" name="search"
- autocomplete="off"
- placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
- type="search">
- </div>
- </form>
- </nav>
-
- <section id='main' class="content"><h1 class='fqn'><span class='in-band'>Function <a href='index.html'>mailparse</a>::<wbr><a class="fn" href=''>dateparse</a></span><span class='out-of-band'><span id='render-detail'>
- <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
- [<span class='inner'>&#x2212;</span>]
- </a>
- </span><a class='srclink' href='../src/mailparse/dateparse.rs.html#76-188' title='goto source code'>[src]</a></span></h1><pre class='rust fn'>pub fn dateparse(date: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>, &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>&gt;</pre><div class='docblock'><p>Convert a date field from an email header into a UNIX epoch timestamp.
-This function handles the most common formatting of date fields found in
-email headers. It may fail to parse some of the more creative formattings.</p>
-<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
-<pre class="rust rust-example-rendered">
- <span class="kw">use</span> <span class="ident">mailparse</span>::<span class="ident">dateparse</span>;
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dateparse</span>(<span class="string">&quot;Sun, 02 Oct 2016 07:06:22 -0700 (PDT)&quot;</span>).<span class="ident">unwrap</span>(), <span class="number">1475417182</span>);</pre>
-</div></section>
- <section id='search' class="content hidden"></section>
-
- <section class="footer"></section>
-
- <aside id="help" class="hidden">
- <div>
- <h1 class="hidden">Help</h1>
-
- <div class="shortcuts">
- <h2>Keyboard Shortcuts</h2>
-
- <dl>
- <dt><kbd>?</kbd></dt>
- <dd>Show this help dialog</dd>
- <dt><kbd>S</kbd></dt>
- <dd>Focus the search field</dd>
- <dt><kbd>↑</kbd></dt>
- <dd>Move up in search results</dd>
- <dt><kbd>↓</kbd></dt>
- <dd>Move down in search results</dd>
- <dt><kbd>↹</kbd></dt>
- <dd>Switch tab</dd>
- <dt><kbd>&#9166;</kbd></dt>
- <dd>Go to active search result</dd>
- <dt><kbd>+</kbd></dt>
- <dd>Expand all sections</dd>
- <dt><kbd>-</kbd></dt>
- <dd>Collapse all sections</dd>
- </dl>
- </div>
-
- <div class="infos">
- <h2>Search Tricks</h2>
-
- <p>
- Prefix searches with a type followed by a colon (e.g.
- <code>fn:</code>) to restrict the search to a given type.
- </p>
-
- <p>
- Accepted types are: <code>fn</code>, <code>mod</code>,
- <code>struct</code>, <code>enum</code>,
- <code>trait</code>, <code>type</code>, <code>macro</code>,
- and <code>const</code>.
- </p>
-
- <p>
- Search functions by type signature (e.g.
- <code>vec -> usize</code> or <code>* -> vec</code>)
- </p>
- </div>
- </div>
- </aside>
-
-
-
- <script>
- window.rootPath = "../";
- window.currentCrate = "mailparse";
- </script>
- <script src="../main.js"></script>
- <script defer src="../search-index.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/fn.parse_content_disposition.html b/target/doc/mailparse/fn.parse_content_disposition.html
deleted file mode 100644
index 736210e..0000000
--- a/target/doc/mailparse/fn.parse_content_disposition.html
+++ /dev/null
@@ -1,139 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="generator" content="rustdoc">
- <meta name="description" content="API documentation for the Rust `parse_content_disposition` fn in crate `mailparse`.">
- <meta name="keywords" content="rust, rustlang, rust-lang, parse_content_disposition">
-
- <title>mailparse::parse_content_disposition - Rust</title>
-
- <link rel="stylesheet" type="text/css" href="../normalize.css">
- <link rel="stylesheet" type="text/css" href="../rustdoc.css"
- id="mainThemeStyle">
-
- <link rel="stylesheet" type="text/css" href="../dark.css">
- <link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle">
- <script src="../storage.js"></script>
-
-
-
-
-</head>
-<body class="rustdoc fn">
- <!--[if lte IE 8]>
- <div class="warning">
- This old browser is unsupported and will most likely display funky
- things.
- </div>
- <![endif]-->
-
-
-
- <nav class="sidebar">
- <div class="sidebar-menu">&#9776;</div>
-
- <div class="sidebar-elems"><p class='location'><a href='index.html'>mailparse</a></p><script>window.sidebarCurrent = {name: 'parse_content_disposition', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
- </nav>
-
- <div class="theme-picker">
- <button id="theme-picker" aria-label="Pick another theme!">
- <img src="../brush.svg" width="18" alt="Pick another theme!">
- </button>
- <div id="theme-choices"></div>
- </div>
- <script src="../theme.js"></script>
- <nav class="sub">
- <form class="search-form js-only">
- <div class="search-container">
- <input class="search-input" name="search"
- autocomplete="off"
- placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
- type="search">
- </div>
- </form>
- </nav>
-
- <section id='main' class="content"><h1 class='fqn'><span class='in-band'>Function <a href='index.html'>mailparse</a>::<wbr><a class="fn" href=''>parse_content_disposition</a></span><span class='out-of-band'><span id='render-detail'>
- <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
- [<span class='inner'>&#x2212;</span>]
- </a>
- </span><a class='srclink' href='../src/mailparse/lib.rs.html#632-639' title='goto source code'>[src]</a></span></h1><pre class='rust fn'>pub fn parse_content_disposition(header: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="../mailparse/struct.ParsedContentDisposition.html" title="struct mailparse::ParsedContentDisposition">ParsedContentDisposition</a></pre><div class='docblock'><p>Helper method to parse a header value as a Content-Disposition header. The disposition
-defaults to &quot;inline&quot; if no disposition parameter is provided in the header
-value.</p>
-<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
-<pre class="rust rust-example-rendered">
- <span class="kw">use</span> <span class="ident">mailparse</span>::{<span class="ident">parse_header</span>, <span class="ident">parse_content_disposition</span>, <span class="ident">DispositionType</span>};
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(
- <span class="string">b&quot;Content-Disposition: attachment; filename=\&quot;yummy dummy\&quot;&quot;</span>)
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">dis</span> <span class="op">=</span> <span class="ident">parse_content_disposition</span>(<span class="kw-2">&amp;</span><span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>());
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dis</span>.<span class="ident">disposition</span>, <span class="ident">DispositionType</span>::<span class="ident">Attachment</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dis</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;name&quot;</span>), <span class="prelude-val">None</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dis</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;filename&quot;</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="string">&quot;yummy dummy&quot;</span>.<span class="ident">to_string</span>()));</pre>
-</div></section>
- <section id='search' class="content hidden"></section>
-
- <section class="footer"></section>
-
- <aside id="help" class="hidden">
- <div>
- <h1 class="hidden">Help</h1>
-
- <div class="shortcuts">
- <h2>Keyboard Shortcuts</h2>
-
- <dl>
- <dt><kbd>?</kbd></dt>
- <dd>Show this help dialog</dd>
- <dt><kbd>S</kbd></dt>
- <dd>Focus the search field</dd>
- <dt><kbd>↑</kbd></dt>
- <dd>Move up in search results</dd>
- <dt><kbd>↓</kbd></dt>
- <dd>Move down in search results</dd>
- <dt><kbd>↹</kbd></dt>
- <dd>Switch tab</dd>
- <dt><kbd>&#9166;</kbd></dt>
- <dd>Go to active search result</dd>
- <dt><kbd>+</kbd></dt>
- <dd>Expand all sections</dd>
- <dt><kbd>-</kbd></dt>
- <dd>Collapse all sections</dd>
- </dl>
- </div>
-
- <div class="infos">
- <h2>Search Tricks</h2>
-
- <p>
- Prefix searches with a type followed by a colon (e.g.
- <code>fn:</code>) to restrict the search to a given type.
- </p>
-
- <p>
- Accepted types are: <code>fn</code>, <code>mod</code>,
- <code>struct</code>, <code>enum</code>,
- <code>trait</code>, <code>type</code>, <code>macro</code>,
- and <code>const</code>.
- </p>
-
- <p>
- Search functions by type signature (e.g.
- <code>vec -> usize</code> or <code>* -> vec</code>)
- </p>
- </div>
- </div>
- </aside>
-
-
-
- <script>
- window.rootPath = "../";
- window.currentCrate = "mailparse";
- </script>
- <script src="../main.js"></script>
- <script defer src="../search-index.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/fn.parse_content_type.html b/target/doc/mailparse/fn.parse_content_type.html
deleted file mode 100644
index b60539e..0000000
--- a/target/doc/mailparse/fn.parse_content_type.html
+++ /dev/null
@@ -1,160 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="generator" content="rustdoc">
- <meta name="description" content="API documentation for the Rust `parse_content_type` fn in crate `mailparse`.">
- <meta name="keywords" content="rust, rustlang, rust-lang, parse_content_type">
-
- <title>mailparse::parse_content_type - Rust</title>
-
- <link rel="stylesheet" type="text/css" href="../normalize.css">
- <link rel="stylesheet" type="text/css" href="../rustdoc.css"
- id="mainThemeStyle">
-
- <link rel="stylesheet" type="text/css" href="../dark.css">
- <link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle">
- <script src="../storage.js"></script>
-
-
-
-
-</head>
-<body class="rustdoc fn">
- <!--[if lte IE 8]>
- <div class="warning">
- This old browser is unsupported and will most likely display funky
- things.
- </div>
- <![endif]-->
-
-
-
- <nav class="sidebar">
- <div class="sidebar-menu">&#9776;</div>
-
- <div class="sidebar-elems"><p class='location'><a href='index.html'>mailparse</a></p><script>window.sidebarCurrent = {name: 'parse_content_type', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
- </nav>
-
- <div class="theme-picker">
- <button id="theme-picker" aria-label="Pick another theme!">
- <img src="../brush.svg" width="18" alt="Pick another theme!">
- </button>
- <div id="theme-choices"></div>
- </div>
- <script src="../theme.js"></script>
- <nav class="sub">
- <form class="search-form js-only">
- <div class="search-container">
- <input class="search-input" name="search"
- autocomplete="off"
- placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
- type="search">
- </div>
- </form>
- </nav>
-
- <section id='main' class="content"><h1 class='fqn'><span class='in-band'>Function <a href='index.html'>mailparse</a>::<wbr><a class="fn" href=''>parse_content_type</a></span><span class='out-of-band'><span id='render-detail'>
- <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
- [<span class='inner'>&#x2212;</span>]
- </a>
- </span><a class='srclink' href='../src/mailparse/lib.rs.html#554-566' title='goto source code'>[src]</a></span></h1><pre class='rust fn'>pub fn parse_content_type(header: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="struct" href="../mailparse/struct.ParsedContentType.html" title="struct mailparse::ParsedContentType">ParsedContentType</a></pre><div class='docblock'><p>Helper method to parse a header value as a Content-Type header. Note that
-the returned object's <code>params</code> map will contain a charset key if a charset
-was explicitly specified in the header; otherwise the <code>params</code> map will not
-contain a charset key. Regardless, the <code>charset</code> field will contain a
-charset - either the one explicitly specified or the default of &quot;us-ascii&quot;.</p>
-<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
-<pre class="rust rust-example-rendered">
- <span class="kw">use</span> <span class="ident">mailparse</span>::{<span class="ident">parse_header</span>, <span class="ident">parse_content_type</span>};
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(
- <span class="string">b&quot;Content-Type: text/html; charset=foo; boundary=\&quot;quotes_are_removed\&quot;&quot;</span>)
- .<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">ctype</span> <span class="op">=</span> <span class="ident">parse_content_type</span>(<span class="kw-2">&amp;</span><span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>());
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">mimetype</span>, <span class="string">&quot;text/html&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">charset</span>, <span class="string">&quot;foo&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;boundary&quot;</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="string">&quot;quotes_are_removed&quot;</span>.<span class="ident">to_string</span>()));
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;charset&quot;</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="string">&quot;foo&quot;</span>.<span class="ident">to_string</span>()));</pre>
-
-<pre class="rust rust-example-rendered">
- <span class="kw">use</span> <span class="ident">mailparse</span>::{<span class="ident">parse_header</span>, <span class="ident">parse_content_type</span>};
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;Content-Type: bogus&quot;</span>).<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">ctype</span> <span class="op">=</span> <span class="ident">parse_content_type</span>(<span class="kw-2">&amp;</span><span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>());
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">mimetype</span>, <span class="string">&quot;bogus&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">charset</span>, <span class="string">&quot;us-ascii&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;boundary&quot;</span>), <span class="prelude-val">None</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;charset&quot;</span>), <span class="prelude-val">None</span>);</pre>
-
-<pre class="rust rust-example-rendered">
- <span class="kw">use</span> <span class="ident">mailparse</span>::{<span class="ident">parse_header</span>, <span class="ident">parse_content_type</span>};
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">br#&quot;Content-Type: application/octet-stream;name=&quot;=?utf8?B?6L+O5ai255m95a+M576O?=&quot;;charset=&quot;utf8&quot;&quot;#</span>).<span class="ident">unwrap</span>();
- <span class="kw">let</span> <span class="ident">ctype</span> <span class="op">=</span> <span class="ident">parse_content_type</span>(<span class="kw-2">&amp;</span><span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>());
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">mimetype</span>, <span class="string">&quot;application/octet-stream&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">charset</span>, <span class="string">&quot;utf8&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;boundary&quot;</span>), <span class="prelude-val">None</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;name&quot;</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="string">&quot;迎娶白富美&quot;</span>.<span class="ident">to_string</span>()));</pre>
-</div></section>
- <section id='search' class="content hidden"></section>
-
- <section class="footer"></section>
-
- <aside id="help" class="hidden">
- <div>
- <h1 class="hidden">Help</h1>
-
- <div class="shortcuts">
- <h2>Keyboard Shortcuts</h2>
-
- <dl>
- <dt><kbd>?</kbd></dt>
- <dd>Show this help dialog</dd>
- <dt><kbd>S</kbd></dt>
- <dd>Focus the search field</dd>
- <dt><kbd>↑</kbd></dt>
- <dd>Move up in search results</dd>
- <dt><kbd>↓</kbd></dt>
- <dd>Move down in search results</dd>
- <dt><kbd>↹</kbd></dt>
- <dd>Switch tab</dd>
- <dt><kbd>&#9166;</kbd></dt>
- <dd>Go to active search result</dd>
- <dt><kbd>+</kbd></dt>
- <dd>Expand all sections</dd>
- <dt><kbd>-</kbd></dt>
- <dd>Collapse all sections</dd>
- </dl>
- </div>
-
- <div class="infos">
- <h2>Search Tricks</h2>
-
- <p>
- Prefix searches with a type followed by a colon (e.g.
- <code>fn:</code>) to restrict the search to a given type.
- </p>
-
- <p>
- Accepted types are: <code>fn</code>, <code>mod</code>,
- <code>struct</code>, <code>enum</code>,
- <code>trait</code>, <code>type</code>, <code>macro</code>,
- and <code>const</code>.
- </p>
-
- <p>
- Search functions by type signature (e.g.
- <code>vec -> usize</code> or <code>* -> vec</code>)
- </p>
- </div>
- </div>
- </aside>
-
-
-
- <script>
- window.rootPath = "../";
- window.currentCrate = "mailparse";
- </script>
- <script src="../main.js"></script>
- <script defer src="../search-index.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/fn.parse_header.html b/target/doc/mailparse/fn.parse_header.html
deleted file mode 100644
index 0bb4899..0000000
--- a/target/doc/mailparse/fn.parse_header.html
+++ /dev/null
@@ -1,144 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="generator" content="rustdoc">
- <meta name="description" content="API documentation for the Rust `parse_header` fn in crate `mailparse`.">
- <meta name="keywords" content="rust, rustlang, rust-lang, parse_header">
-
- <title>mailparse::parse_header - Rust</title>
-
- <link rel="stylesheet" type="text/css" href="../normalize.css">
- <link rel="stylesheet" type="text/css" href="../rustdoc.css"
- id="mainThemeStyle">
-
- <link rel="stylesheet" type="text/css" href="../dark.css">
- <link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle">
- <script src="../storage.js"></script>
-
-
-
-
-</head>
-<body class="rustdoc fn">
- <!--[if lte IE 8]>
- <div class="warning">
- This old browser is unsupported and will most likely display funky
- things.
- </div>
- <![endif]-->
-
-
-
- <nav class="sidebar">
- <div class="sidebar-menu">&#9776;</div>
-
- <div class="sidebar-elems"><p class='location'><a href='index.html'>mailparse</a></p><script>window.sidebarCurrent = {name: 'parse_header', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
- </nav>
-
- <div class="theme-picker">
- <button id="theme-picker" aria-label="Pick another theme!">
- <img src="../brush.svg" width="18" alt="Pick another theme!">
- </button>
- <div id="theme-choices"></div>
- </div>
- <script src="../theme.js"></script>
- <nav class="sub">
- <form class="search-form js-only">
- <div class="search-container">
- <input class="search-input" name="search"
- autocomplete="off"
- placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
- type="search">
- </div>
- </form>
- </nav>
-
- <section id='main' class="content"><h1 class='fqn'><span class='in-band'>Function <a href='index.html'>mailparse</a>::<wbr><a class="fn" href=''>parse_header</a></span><span class='out-of-band'><span id='render-detail'>
- <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
- [<span class='inner'>&#x2212;</span>]
- </a>
- </span><a class='srclink' href='../src/mailparse/lib.rs.html#301-380' title='goto source code'>[src]</a></span></h1><pre class='rust fn'>pub fn parse_header(<br>&nbsp;&nbsp;&nbsp;&nbsp;raw_data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="../mailparse/struct.MailHeader.html" title="struct mailparse::MailHeader">MailHeader</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a>&gt;</pre><div class='docblock'><p>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
-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.</p>
-<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
-<pre class="rust rust-example-rendered">
- <span class="kw">use</span> <span class="ident">mailparse</span>::<span class="ident">parse_header</span>;
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="macro">concat</span><span class="macro">!</span>(
- <span class="string">&quot;Subject: Hello, sir,\n&quot;</span>,
- <span class="string">&quot; I am multiline\n&quot;</span>,
- <span class="string">&quot;Next:Header&quot;</span>).<span class="ident">as_bytes</span>())
- .<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_key</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;Subject&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;Hello, sir, I am multiline&quot;</span>);</pre>
-</div></section>
- <section id='search' class="content hidden"></section>
-
- <section class="footer"></section>
-
- <aside id="help" class="hidden">
- <div>
- <h1 class="hidden">Help</h1>
-
- <div class="shortcuts">
- <h2>Keyboard Shortcuts</h2>
-
- <dl>
- <dt><kbd>?</kbd></dt>
- <dd>Show this help dialog</dd>
- <dt><kbd>S</kbd></dt>
- <dd>Focus the search field</dd>
- <dt><kbd>↑</kbd></dt>
- <dd>Move up in search results</dd>
- <dt><kbd>↓</kbd></dt>
- <dd>Move down in search results</dd>
- <dt><kbd>↹</kbd></dt>
- <dd>Switch tab</dd>
- <dt><kbd>&#9166;</kbd></dt>
- <dd>Go to active search result</dd>
- <dt><kbd>+</kbd></dt>
- <dd>Expand all sections</dd>
- <dt><kbd>-</kbd></dt>
- <dd>Collapse all sections</dd>
- </dl>
- </div>
-
- <div class="infos">
- <h2>Search Tricks</h2>
-
- <p>
- Prefix searches with a type followed by a colon (e.g.
- <code>fn:</code>) to restrict the search to a given type.
- </p>
-
- <p>
- Accepted types are: <code>fn</code>, <code>mod</code>,
- <code>struct</code>, <code>enum</code>,
- <code>trait</code>, <code>type</code>, <code>macro</code>,
- and <code>const</code>.
- </p>
-
- <p>
- Search functions by type signature (e.g.
- <code>vec -> usize</code> or <code>* -> vec</code>)
- </p>
- </div>
- </div>
- </aside>
-
-
-
- <script>
- window.rootPath = "../";
- window.currentCrate = "mailparse";
- </script>
- <script src="../main.js"></script>
- <script defer src="../search-index.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/fn.parse_headers.html b/target/doc/mailparse/fn.parse_headers.html
deleted file mode 100644
index 6067747..0000000
--- a/target/doc/mailparse/fn.parse_headers.html
+++ /dev/null
@@ -1,147 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="generator" content="rustdoc">
- <meta name="description" content="API documentation for the Rust `parse_headers` fn in crate `mailparse`.">
- <meta name="keywords" content="rust, rustlang, rust-lang, parse_headers">
-
- <title>mailparse::parse_headers - Rust</title>
-
- <link rel="stylesheet" type="text/css" href="../normalize.css">
- <link rel="stylesheet" type="text/css" href="../rustdoc.css"
- id="mainThemeStyle">
-
- <link rel="stylesheet" type="text/css" href="../dark.css">
- <link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle">
- <script src="../storage.js"></script>
-
-
-
-
-</head>
-<body class="rustdoc fn">
- <!--[if lte IE 8]>
- <div class="warning">
- This old browser is unsupported and will most likely display funky
- things.
- </div>
- <![endif]-->
-
-
-
- <nav class="sidebar">
- <div class="sidebar-menu">&#9776;</div>
-
- <div class="sidebar-elems"><p class='location'><a href='index.html'>mailparse</a></p><script>window.sidebarCurrent = {name: 'parse_headers', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
- </nav>
-
- <div class="theme-picker">
- <button id="theme-picker" aria-label="Pick another theme!">
- <img src="../brush.svg" width="18" alt="Pick another theme!">
- </button>
- <div id="theme-choices"></div>
- </div>
- <script src="../theme.js"></script>
- <nav class="sub">
- <form class="search-form js-only">
- <div class="search-container">
- <input class="search-input" name="search"
- autocomplete="off"
- placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
- type="search">
- </div>
- </form>
- </nav>
-
- <section id='main' class="content"><h1 class='fqn'><span class='in-band'>Function <a href='index.html'>mailparse</a>::<wbr><a class="fn" href=''>parse_headers</a></span><span class='out-of-band'><span id='render-detail'>
- <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
- [<span class='inner'>&#x2212;</span>]
- </a>
- </span><a class='srclink' href='../src/mailparse/lib.rs.html#465-490' title='goto source code'>[src]</a></span></h1><pre class='rust fn'>pub fn parse_headers(<br>&nbsp;&nbsp;&nbsp;&nbsp;raw_data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a><br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">(</a><a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="../mailparse/struct.MailHeader.html" title="struct mailparse::MailHeader">MailHeader</a>&gt;, <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">)</a>, <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a>&gt;</pre><div class='docblock'><p>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
-headers and returns them in a vector. The normal vector functions can be
-used to access the headers linearly, or the MailHeaderMap trait can be used
-to access them in a map-like fashion. Along with this vector, the function
-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.</p>
-<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
-<pre class="rust rust-example-rendered">
- <span class="kw">use</span> <span class="ident">mailparse</span>::{<span class="ident">parse_headers</span>, <span class="ident">MailHeaderMap</span>};
- <span class="kw">let</span> (<span class="ident">headers</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_headers</span>(<span class="macro">concat</span><span class="macro">!</span>(
- <span class="string">&quot;Subject: Test\n&quot;</span>,
- <span class="string">&quot;From: me@myself.com\n&quot;</span>,
- <span class="string">&quot;To: you@yourself.com&quot;</span>).<span class="ident">as_bytes</span>())
- .<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">headers</span>[<span class="number">1</span>].<span class="ident">get_key</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;From&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">headers</span>.<span class="ident">get_first_value</span>(<span class="string">&quot;To&quot;</span>).<span class="ident">unwrap</span>(), <span class="prelude-val">Some</span>(<span class="string">&quot;you@yourself.com&quot;</span>.<span class="ident">to_string</span>()));</pre>
-</div></section>
- <section id='search' class="content hidden"></section>
-
- <section class="footer"></section>
-
- <aside id="help" class="hidden">
- <div>
- <h1 class="hidden">Help</h1>
-
- <div class="shortcuts">
- <h2>Keyboard Shortcuts</h2>
-
- <dl>
- <dt><kbd>?</kbd></dt>
- <dd>Show this help dialog</dd>
- <dt><kbd>S</kbd></dt>
- <dd>Focus the search field</dd>
- <dt><kbd>↑</kbd></dt>
- <dd>Move up in search results</dd>
- <dt><kbd>↓</kbd></dt>
- <dd>Move down in search results</dd>
- <dt><kbd>↹</kbd></dt>
- <dd>Switch tab</dd>
- <dt><kbd>&#9166;</kbd></dt>
- <dd>Go to active search result</dd>
- <dt><kbd>+</kbd></dt>
- <dd>Expand all sections</dd>
- <dt><kbd>-</kbd></dt>
- <dd>Collapse all sections</dd>
- </dl>
- </div>
-
- <div class="infos">
- <h2>Search Tricks</h2>
-
- <p>
- Prefix searches with a type followed by a colon (e.g.
- <code>fn:</code>) to restrict the search to a given type.
- </p>
-
- <p>
- Accepted types are: <code>fn</code>, <code>mod</code>,
- <code>struct</code>, <code>enum</code>,
- <code>trait</code>, <code>type</code>, <code>macro</code>,
- and <code>const</code>.
- </p>
-
- <p>
- Search functions by type signature (e.g.
- <code>vec -> usize</code> or <code>* -> vec</code>)
- </p>
- </div>
- </div>
- </aside>
-
-
-
- <script>
- window.rootPath = "../";
- window.currentCrate = "mailparse";
- </script>
- <script src="../main.js"></script>
- <script defer src="../search-index.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/fn.parse_mail.html b/target/doc/mailparse/fn.parse_mail.html
deleted file mode 100644
index a14735a..0000000
--- a/target/doc/mailparse/fn.parse_mail.html
+++ /dev/null
@@ -1,161 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="generator" content="rustdoc">
- <meta name="description" content="API documentation for the Rust `parse_mail` fn in crate `mailparse`.">
- <meta name="keywords" content="rust, rustlang, rust-lang, parse_mail">
-
- <title>mailparse::parse_mail - Rust</title>
-
- <link rel="stylesheet" type="text/css" href="../normalize.css">
- <link rel="stylesheet" type="text/css" href="../rustdoc.css"
- id="mainThemeStyle">
-
- <link rel="stylesheet" type="text/css" href="../dark.css">
- <link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle">
- <script src="../storage.js"></script>
-
-
-
-
-</head>
-<body class="rustdoc fn">
- <!--[if lte IE 8]>
- <div class="warning">
- This old browser is unsupported and will most likely display funky
- things.
- </div>
- <![endif]-->
-
-
-
- <nav class="sidebar">
- <div class="sidebar-menu">&#9776;</div>
-
- <div class="sidebar-elems"><p class='location'><a href='index.html'>mailparse</a></p><script>window.sidebarCurrent = {name: 'parse_mail', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
- </nav>
-
- <div class="theme-picker">
- <button id="theme-picker" aria-label="Pick another theme!">
- <img src="../brush.svg" width="18" alt="Pick another theme!">
- </button>
- <div id="theme-choices"></div>
- </div>
- <script src="../theme.js"></script>
- <nav class="sub">
- <form class="search-form js-only">
- <div class="search-container">
- <input class="search-input" name="search"
- autocomplete="off"
- placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
- type="search">
- </div>
- </form>
- </nav>
-
- <section id='main' class="content"><h1 class='fqn'><span class='in-band'>Function <a href='index.html'>mailparse</a>::<wbr><a class="fn" href=''>parse_mail</a></span><span class='out-of-band'><span id='render-detail'>
- <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
- [<span class='inner'>&#x2212;</span>]
- </a>
- </span><a class='srclink' href='../src/mailparse/lib.rs.html#775-814' title='goto source code'>[src]</a></span></h1><pre class='rust fn'>pub fn parse_mail(raw_data: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">&amp;[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.slice.html">]</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../mailparse/struct.ParsedMail.html" title="struct mailparse::ParsedMail">ParsedMail</a>, <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a>&gt;</pre><div class='docblock'><p>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.</p>
-<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
-<pre class="rust rust-example-rendered">
- <span class="kw">use</span> <span class="ident">mailparse</span>::<span class="kw-2">*</span>;
- <span class="kw">let</span> <span class="ident">parsed</span> <span class="op">=</span> <span class="ident">parse_mail</span>(<span class="macro">concat</span><span class="macro">!</span>(
- <span class="string">&quot;Subject: This is a test email\n&quot;</span>,
- <span class="string">&quot;Content-Type: multipart/alternative; boundary=foobar\n&quot;</span>,
- <span class="string">&quot;Date: Sun, 02 Oct 2016 07:06:22 -0700 (PDT)\n&quot;</span>,
- <span class="string">&quot;\n&quot;</span>,
- <span class="string">&quot;--foobar\n&quot;</span>,
- <span class="string">&quot;Content-Type: text/plain; charset=utf-8\n&quot;</span>,
- <span class="string">&quot;Content-Transfer-Encoding: quoted-printable\n&quot;</span>,
- <span class="string">&quot;\n&quot;</span>,
- <span class="string">&quot;This is the plaintext version, in utf-8. Proof by Euro: =E2=82=AC\n&quot;</span>,
- <span class="string">&quot;--foobar\n&quot;</span>,
- <span class="string">&quot;Content-Type: text/html\n&quot;</span>,
- <span class="string">&quot;Content-Transfer-Encoding: base64\n&quot;</span>,
- <span class="string">&quot;\n&quot;</span>,
- <span class="string">&quot;PGh0bWw+PGJvZHk+VGhpcyBpcyB0aGUgPGI+SFRNTDwvYj4gdmVyc2lvbiwgaW4g \n&quot;</span>,
- <span class="string">&quot;dXMtYXNjaWkuIFByb29mIGJ5IEV1cm86ICZldXJvOzwvYm9keT48L2h0bWw+Cg== \n&quot;</span>,
- <span class="string">&quot;--foobar--\n&quot;</span>,
- <span class="string">&quot;After the final boundary stuff gets ignored.\n&quot;</span>).<span class="ident">as_bytes</span>())
- .<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">headers</span>.<span class="ident">get_first_value</span>(<span class="string">&quot;Subject&quot;</span>).<span class="ident">unwrap</span>(),
- <span class="prelude-val">Some</span>(<span class="string">&quot;This is a test email&quot;</span>.<span class="ident">to_string</span>()));
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">subparts</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">subparts</span>[<span class="number">0</span>].<span class="ident">get_body</span>().<span class="ident">unwrap</span>(),
- <span class="string">&quot;This is the plaintext version, in utf-8. Proof by Euro: \u{20AC}&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">subparts</span>[<span class="number">1</span>].<span class="ident">headers</span>[<span class="number">1</span>].<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;base64&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">subparts</span>[<span class="number">1</span>].<span class="ident">ctype</span>.<span class="ident">mimetype</span>, <span class="string">&quot;text/html&quot;</span>);
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">subparts</span>[<span class="number">1</span>].<span class="ident">get_body</span>().<span class="ident">unwrap</span>().<span class="ident">starts_with</span>(<span class="string">&quot;&lt;html&gt;&quot;</span>));
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dateparse</span>(<span class="ident">parsed</span>.<span class="ident">headers</span>.<span class="ident">get_first_value</span>(<span class="string">&quot;Date&quot;</span>).<span class="ident">unwrap</span>().<span class="ident">unwrap</span>().<span class="ident">as_str</span>()).<span class="ident">unwrap</span>(), <span class="number">1475417182</span>);</pre>
-</div></section>
- <section id='search' class="content hidden"></section>
-
- <section class="footer"></section>
-
- <aside id="help" class="hidden">
- <div>
- <h1 class="hidden">Help</h1>
-
- <div class="shortcuts">
- <h2>Keyboard Shortcuts</h2>
-
- <dl>
- <dt><kbd>?</kbd></dt>
- <dd>Show this help dialog</dd>
- <dt><kbd>S</kbd></dt>
- <dd>Focus the search field</dd>
- <dt><kbd>↑</kbd></dt>
- <dd>Move up in search results</dd>
- <dt><kbd>↓</kbd></dt>
- <dd>Move down in search results</dd>
- <dt><kbd>↹</kbd></dt>
- <dd>Switch tab</dd>
- <dt><kbd>&#9166;</kbd></dt>
- <dd>Go to active search result</dd>
- <dt><kbd>+</kbd></dt>
- <dd>Expand all sections</dd>
- <dt><kbd>-</kbd></dt>
- <dd>Collapse all sections</dd>
- </dl>
- </div>
-
- <div class="infos">
- <h2>Search Tricks</h2>
-
- <p>
- Prefix searches with a type followed by a colon (e.g.
- <code>fn:</code>) to restrict the search to a given type.
- </p>
-
- <p>
- Accepted types are: <code>fn</code>, <code>mod</code>,
- <code>struct</code>, <code>enum</code>,
- <code>trait</code>, <code>type</code>, <code>macro</code>,
- and <code>const</code>.
- </p>
-
- <p>
- Search functions by type signature (e.g.
- <code>vec -> usize</code> or <code>* -> vec</code>)
- </p>
- </div>
- </div>
- </aside>
-
-
-
- <script>
- window.rootPath = "../";
- window.currentCrate = "mailparse";
- </script>
- <script src="../main.js"></script>
- <script defer src="../search-index.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/index.html b/target/doc/mailparse/index.html
deleted file mode 100644
index 9ec069b..0000000
--- a/target/doc/mailparse/index.html
+++ /dev/null
@@ -1,280 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="generator" content="rustdoc">
- <meta name="description" content="API documentation for the Rust `mailparse` crate.">
- <meta name="keywords" content="rust, rustlang, rust-lang, mailparse">
-
- <title>mailparse - Rust</title>
-
- <link rel="stylesheet" type="text/css" href="../normalize.css">
- <link rel="stylesheet" type="text/css" href="../rustdoc.css"
- id="mainThemeStyle">
-
- <link rel="stylesheet" type="text/css" href="../dark.css">
- <link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle">
- <script src="../storage.js"></script>
-
-
-
-
-</head>
-<body class="rustdoc mod">
- <!--[if lte IE 8]>
- <div class="warning">
- This old browser is unsupported and will most likely display funky
- things.
- </div>
- <![endif]-->
-
-
-
- <nav class="sidebar">
- <div class="sidebar-menu">&#9776;</div>
-
- <p class='location'>Crate mailparse</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'mailparse', ty: 'mod', relpath: '../'};</script></div>
- </nav>
-
- <div class="theme-picker">
- <button id="theme-picker" aria-label="Pick another theme!">
- <img src="../brush.svg" width="18" alt="Pick another theme!">
- </button>
- <div id="theme-choices"></div>
- </div>
- <script src="../theme.js"></script>
- <nav class="sub">
- <form class="search-form js-only">
- <div class="search-container">
- <input class="search-input" name="search"
- autocomplete="off"
- placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
- type="search">
- </div>
- </form>
- </nav>
-
- <section id='main' class="content"><h1 class='fqn'><span class='in-band'>Crate <a class="mod" href=''>mailparse</a></span><span class='out-of-band'><span id='render-detail'>
- <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
- [<span class='inner'>&#x2212;</span>]
- </a>
- </span><a class='srclink' href='../src/mailparse/lib.rs.html#1-1226' title='goto source code'>[src]</a></span></h1><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
-<table>
- <tr class=' module-item'>
- <td><a class="struct" href="struct.MailHeader.html"
- title='struct mailparse::MailHeader'>MailHeader</a></td>
- <td class='docblock-short'>
- <p>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.</p>
-
- </td>
- </tr>
- <tr class=' module-item'>
- <td><a class="struct" href="struct.ParsedContentDisposition.html"
- title='struct mailparse::ParsedContentDisposition'>ParsedContentDisposition</a></td>
- <td class='docblock-short'>
- <p>A struct to hold a more structured representation of the Content-Disposition header.
-This is provided mostly as a convenience since this metadata is usually
-needed to interpret the message body properly.</p>
-
- </td>
- </tr>
- <tr class=' module-item'>
- <td><a class="struct" href="struct.ParsedContentType.html"
- title='struct mailparse::ParsedContentType'>ParsedContentType</a></td>
- <td class='docblock-short'>
- <p>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.</p>
-
- </td>
- </tr>
- <tr class=' module-item'>
- <td><a class="struct" href="struct.ParsedMail.html"
- title='struct mailparse::ParsedMail'>ParsedMail</a></td>
- <td class='docblock-short'>
- <p>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.</p>
-
- </td>
- </tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
-<table>
- <tr class=' module-item'>
- <td><a class="enum" href="enum.DispositionType.html"
- title='enum mailparse::DispositionType'>DispositionType</a></td>
- <td class='docblock-short'>
- <p>The possible disposition types in a Content-Disposition header. A more
-comprehensive list of IANA-recognized types can be found at
-https://www.iana.org/assignments/cont-disp/cont-disp.xhtml. This library
-only enumerates the types most commonly found in email messages, and
-provides the <code>Extension</code> value for holding all other types.</p>
-
- </td>
- </tr>
- <tr class=' module-item'>
- <td><a class="enum" href="enum.MailParseError.html"
- title='enum mailparse::MailParseError'>MailParseError</a></td>
- <td class='docblock-short'>
- <p>An error type that represents the different kinds of errors that may be
-encountered during message parsing.</p>
-
- </td>
- </tr></table><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
-<table>
- <tr class=' module-item'>
- <td><a class="trait" href="trait.MailHeaderMap.html"
- title='trait mailparse::MailHeaderMap'>MailHeaderMap</a></td>
- <td class='docblock-short'>
- <p>A trait that is implemented by the Vec<MailHeader> returned by the parse_headers
-function. It provides a map-like interface to look up header values by their
-name.</p>
-
- </td>
- </tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
-<table>
- <tr class=' module-item'>
- <td><a class="fn" href="fn.dateparse.html"
- title='fn mailparse::dateparse'>dateparse</a></td>
- <td class='docblock-short'>
- <p>Convert a date field from an email header into a UNIX epoch timestamp.
-This function handles the most common formatting of date fields found in
-email headers. It may fail to parse some of the more creative formattings.</p>
-
- </td>
- </tr>
- <tr class=' module-item'>
- <td><a class="fn" href="fn.parse_content_disposition.html"
- title='fn mailparse::parse_content_disposition'>parse_content_disposition</a></td>
- <td class='docblock-short'>
- <p>Helper method to parse a header value as a Content-Disposition header. The disposition
-defaults to &quot;inline&quot; if no disposition parameter is provided in the header
-value.</p>
-
- </td>
- </tr>
- <tr class=' module-item'>
- <td><a class="fn" href="fn.parse_content_type.html"
- title='fn mailparse::parse_content_type'>parse_content_type</a></td>
- <td class='docblock-short'>
- <p>Helper method to parse a header value as a Content-Type header. Note that
-the returned object's <code>params</code> map will contain a charset key if a charset
-was explicitly specified in the header; otherwise the <code>params</code> map will not
-contain a charset key. Regardless, the <code>charset</code> field will contain a
-charset - either the one explicitly specified or the default of &quot;us-ascii&quot;.</p>
-
- </td>
- </tr>
- <tr class=' module-item'>
- <td><a class="fn" href="fn.parse_header.html"
- title='fn mailparse::parse_header'>parse_header</a></td>
- <td class='docblock-short'>
- <p>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
-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.</p>
-
- </td>
- </tr>
- <tr class=' module-item'>
- <td><a class="fn" href="fn.parse_headers.html"
- title='fn mailparse::parse_headers'>parse_headers</a></td>
- <td class='docblock-short'>
- <p>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
-headers and returns them in a vector. The normal vector functions can be
-used to access the headers linearly, or the MailHeaderMap trait can be used
-to access them in a map-like fashion. Along with this vector, the function
-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.</p>
-
- </td>
- </tr>
- <tr class=' module-item'>
- <td><a class="fn" href="fn.parse_mail.html"
- title='fn mailparse::parse_mail'>parse_mail</a></td>
- <td class='docblock-short'>
- <p>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.</p>
-
- </td>
- </tr></table></section>
- <section id='search' class="content hidden"></section>
-
- <section class="footer"></section>
-
- <aside id="help" class="hidden">
- <div>
- <h1 class="hidden">Help</h1>
-
- <div class="shortcuts">
- <h2>Keyboard Shortcuts</h2>
-
- <dl>
- <dt><kbd>?</kbd></dt>
- <dd>Show this help dialog</dd>
- <dt><kbd>S</kbd></dt>
- <dd>Focus the search field</dd>
- <dt><kbd>↑</kbd></dt>
- <dd>Move up in search results</dd>
- <dt><kbd>↓</kbd></dt>
- <dd>Move down in search results</dd>
- <dt><kbd>↹</kbd></dt>
- <dd>Switch tab</dd>
- <dt><kbd>&#9166;</kbd></dt>
- <dd>Go to active search result</dd>
- <dt><kbd>+</kbd></dt>
- <dd>Expand all sections</dd>
- <dt><kbd>-</kbd></dt>
- <dd>Collapse all sections</dd>
- </dl>
- </div>
-
- <div class="infos">
- <h2>Search Tricks</h2>
-
- <p>
- Prefix searches with a type followed by a colon (e.g.
- <code>fn:</code>) to restrict the search to a given type.
- </p>
-
- <p>
- Accepted types are: <code>fn</code>, <code>mod</code>,
- <code>struct</code>, <code>enum</code>,
- <code>trait</code>, <code>type</code>, <code>macro</code>,
- and <code>const</code>.
- </p>
-
- <p>
- Search functions by type signature (e.g.
- <code>vec -> usize</code> or <code>* -> vec</code>)
- </p>
- </div>
- </div>
- </aside>
-
-
-
- <script>
- window.rootPath = "../";
- window.currentCrate = "mailparse";
- </script>
- <script src="../main.js"></script>
- <script defer src="../search-index.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/parse_content_disposition.v.html b/target/doc/mailparse/parse_content_disposition.v.html
deleted file mode 100644
index efad764..0000000
--- a/target/doc/mailparse/parse_content_disposition.v.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=fn.parse_content_disposition.html">
-</head>
-<body>
- <p>Redirecting to <a href="fn.parse_content_disposition.html">fn.parse_content_disposition.html</a>...</p>
- <script>location.replace("fn.parse_content_disposition.html" + location.search + location.hash);</script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/parse_content_type.v.html b/target/doc/mailparse/parse_content_type.v.html
deleted file mode 100644
index 5942c80..0000000
--- a/target/doc/mailparse/parse_content_type.v.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=fn.parse_content_type.html">
-</head>
-<body>
- <p>Redirecting to <a href="fn.parse_content_type.html">fn.parse_content_type.html</a>...</p>
- <script>location.replace("fn.parse_content_type.html" + location.search + location.hash);</script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/parse_header.v.html b/target/doc/mailparse/parse_header.v.html
deleted file mode 100644
index 080d33d..0000000
--- a/target/doc/mailparse/parse_header.v.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=fn.parse_header.html">
-</head>
-<body>
- <p>Redirecting to <a href="fn.parse_header.html">fn.parse_header.html</a>...</p>
- <script>location.replace("fn.parse_header.html" + location.search + location.hash);</script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/parse_headers.v.html b/target/doc/mailparse/parse_headers.v.html
deleted file mode 100644
index 895d283..0000000
--- a/target/doc/mailparse/parse_headers.v.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=fn.parse_headers.html">
-</head>
-<body>
- <p>Redirecting to <a href="fn.parse_headers.html">fn.parse_headers.html</a>...</p>
- <script>location.replace("fn.parse_headers.html" + location.search + location.hash);</script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/parse_mail.v.html b/target/doc/mailparse/parse_mail.v.html
deleted file mode 100644
index d061b43..0000000
--- a/target/doc/mailparse/parse_mail.v.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta http-equiv="refresh" content="0;URL=fn.parse_mail.html">
-</head>
-<body>
- <p>Redirecting to <a href="fn.parse_mail.html">fn.parse_mail.html</a>...</p>
- <script>location.replace("fn.parse_mail.html" + location.search + location.hash);</script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/sidebar-items.js b/target/doc/mailparse/sidebar-items.js
deleted file mode 100644
index 92bf959..0000000
--- a/target/doc/mailparse/sidebar-items.js
+++ /dev/null
@@ -1 +0,0 @@
-initSidebarItems({"enum":[["DispositionType","The possible disposition types in a Content-Disposition header. A more comprehensive list of IANA-recognized types can be found at https://www.iana.org/assignments/cont-disp/cont-disp.xhtml. This library only enumerates the types most commonly found in email messages, and provides the `Extension` value for holding all other types."],["MailParseError","An error type that represents the different kinds of errors that may be encountered during message parsing."]],"fn":[["dateparse","Convert a date field from an email header into a UNIX epoch timestamp. This function handles the most common formatting of date fields found in email headers. It may fail to parse some of the more creative formattings."],["parse_content_disposition","Helper method to parse a header value as a Content-Disposition header. The disposition defaults to \"inline\" if no disposition parameter is provided in the header value."],["parse_content_type","Helper method to parse a header value as a Content-Type header. Note that the returned object's `params` map will contain a charset key if a charset was explicitly specified in the header; otherwise the `params` map will not contain a charset key. Regardless, the `charset` field will contain a charset - either the one explicitly specified or the default of \"us-ascii\"."],["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 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. 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 headers and returns them in a vector. The normal vector functions can be used to access the headers linearly, or the MailHeaderMap trait can be used to access them in a map-like fashion. Along with this vector, the function 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. 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."]],"struct":[["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."],["ParsedContentDisposition","A struct to hold a more structured representation of the Content-Disposition header. This is provided mostly as a convenience since this metadata is usually needed to interpret the message body properly."],["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 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."]],"trait":[["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."]]}); \ No newline at end of file
diff --git a/target/doc/mailparse/struct.MailHeader.html b/target/doc/mailparse/struct.MailHeader.html
deleted file mode 100644
index d8b94b6..0000000
--- a/target/doc/mailparse/struct.MailHeader.html
+++ /dev/null
@@ -1,158 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="generator" content="rustdoc">
- <meta name="description" content="API documentation for the Rust `MailHeader` struct in crate `mailparse`.">
- <meta name="keywords" content="rust, rustlang, rust-lang, MailHeader">
-
- <title>mailparse::MailHeader - Rust</title>
-
- <link rel="stylesheet" type="text/css" href="../normalize.css">
- <link rel="stylesheet" type="text/css" href="../rustdoc.css"
- id="mainThemeStyle">
-
- <link rel="stylesheet" type="text/css" href="../dark.css">
- <link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle">
- <script src="../storage.js"></script>
-
-
-
-
-</head>
-<body class="rustdoc struct">
- <!--[if lte IE 8]>
- <div class="warning">
- This old browser is unsupported and will most likely display funky
- things.
- </div>
- <![endif]-->
-
-
-
- <nav class="sidebar">
- <div class="sidebar-menu">&#9776;</div>
-
- <p class='location'>Struct MailHeader</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.get_key">get_key</a><a href="#method.get_value">get_value</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='index.html'>mailparse</a></p><script>window.sidebarCurrent = {name: 'MailHeader', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
- </nav>
-
- <div class="theme-picker">
- <button id="theme-picker" aria-label="Pick another theme!">
- <img src="../brush.svg" width="18" alt="Pick another theme!">
- </button>
- <div id="theme-choices"></div>
- </div>
- <script src="../theme.js"></script>
- <nav class="sub">
- <form class="search-form js-only">
- <div class="search-container">
- <input class="search-input" name="search"
- autocomplete="off"
- placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
- type="search">
- </div>
- </form>
- </nav>
-
- <section id='main' class="content"><h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>mailparse</a>::<wbr><a class="struct" href=''>MailHeader</a></span><span class='out-of-band'><span id='render-detail'>
- <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
- [<span class='inner'>&#x2212;</span>]
- </a>
- </span><a class='srclink' href='../src/mailparse/lib.rs.html#92-95' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct MailHeader&lt;'a&gt; { /* fields omitted */ }</pre></div><div class='docblock'><p>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.</p>
-</div>
- <h2 id='methods' class='small-section-header'>
- Methods<a href='#methods' class='anchor'></a>
- </h2>
- <h3 id='impl' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a&gt; <a class="struct" href="../mailparse/struct.MailHeader.html" title="struct mailparse::MailHeader">MailHeader</a>&lt;'a&gt;</code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#147-270' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.get_key' class="method"><span id='get_key.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_key' class='fnname'>get_key</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#149-157' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Get the name of the header. Note that header names are case-insensitive.</p>
-</div><h4 id='method.get_value' class="method"><span id='get_value.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_value' class='fnname'>get_value</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#205-269' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Get the value of the header. Any sequences of newlines characters followed
-by whitespace are collapsed into a single space. In effect, header values
-wrapped across multiple lines are compacted back into one line, while
-discarding the extra whitespace required by the MIME format. Additionally,
-any quoted-printable words in the value are decoded.</p>
-<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
-<pre class="rust rust-example-rendered">
- <span class="kw">use</span> <span class="ident">mailparse</span>::<span class="ident">parse_header</span>;
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;Subject: =?iso-8859-1?Q?=A1Hola,_se=F1or!?=&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_key</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;Subject&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;\u{a1}Hola, se\u{f1}or!&quot;</span>);</pre>
-</div></div>
- <h2 id='implementations' class='small-section-header'>
- Trait Implementations<a href='#implementations' class='anchor'></a>
- </h2>
- <div id='implementations-list'>
- <h3 id='impl-Debug' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../mailparse/struct.MailHeader.html" title="struct mailparse::MailHeader">MailHeader</a>&lt;'a&gt;</code><a href='#impl-Debug' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#91' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#91' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div></div>
- <h2 id='synthetic-implementations' class='small-section-header'>
- Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
- </h2>
- <div id='synthetic-implementations-list'>
- <h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../mailparse/struct.MailHeader.html" title="struct mailparse::MailHeader">MailHeader</a>&lt;'a&gt;</code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../mailparse/struct.MailHeader.html" title="struct mailparse::MailHeader">MailHeader</a>&lt;'a&gt;</code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div></div></section>
- <section id='search' class="content hidden"></section>
-
- <section class="footer"></section>
-
- <aside id="help" class="hidden">
- <div>
- <h1 class="hidden">Help</h1>
-
- <div class="shortcuts">
- <h2>Keyboard Shortcuts</h2>
-
- <dl>
- <dt><kbd>?</kbd></dt>
- <dd>Show this help dialog</dd>
- <dt><kbd>S</kbd></dt>
- <dd>Focus the search field</dd>
- <dt><kbd>↑</kbd></dt>
- <dd>Move up in search results</dd>
- <dt><kbd>↓</kbd></dt>
- <dd>Move down in search results</dd>
- <dt><kbd>↹</kbd></dt>
- <dd>Switch tab</dd>
- <dt><kbd>&#9166;</kbd></dt>
- <dd>Go to active search result</dd>
- <dt><kbd>+</kbd></dt>
- <dd>Expand all sections</dd>
- <dt><kbd>-</kbd></dt>
- <dd>Collapse all sections</dd>
- </dl>
- </div>
-
- <div class="infos">
- <h2>Search Tricks</h2>
-
- <p>
- Prefix searches with a type followed by a colon (e.g.
- <code>fn:</code>) to restrict the search to a given type.
- </p>
-
- <p>
- Accepted types are: <code>fn</code>, <code>mod</code>,
- <code>struct</code>, <code>enum</code>,
- <code>trait</code>, <code>type</code>, <code>macro</code>,
- and <code>const</code>.
- </p>
-
- <p>
- Search functions by type signature (e.g.
- <code>vec -> usize</code> or <code>* -> vec</code>)
- </p>
- </div>
- </div>
- </aside>
-
-
-
- <script>
- window.rootPath = "../";
- window.currentCrate = "mailparse";
- </script>
- <script src="../main.js"></script>
- <script defer src="../search-index.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/struct.ParsedContentDisposition.html b/target/doc/mailparse/struct.ParsedContentDisposition.html
deleted file mode 100644
index ae3c134..0000000
--- a/target/doc/mailparse/struct.ParsedContentDisposition.html
+++ /dev/null
@@ -1,158 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="generator" content="rustdoc">
- <meta name="description" content="API documentation for the Rust `ParsedContentDisposition` struct in crate `mailparse`.">
- <meta name="keywords" content="rust, rustlang, rust-lang, ParsedContentDisposition">
-
- <title>mailparse::ParsedContentDisposition - Rust</title>
-
- <link rel="stylesheet" type="text/css" href="../normalize.css">
- <link rel="stylesheet" type="text/css" href="../rustdoc.css"
- id="mainThemeStyle">
-
- <link rel="stylesheet" type="text/css" href="../dark.css">
- <link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle">
- <script src="../storage.js"></script>
-
-
-
-
-</head>
-<body class="rustdoc struct">
- <!--[if lte IE 8]>
- <div class="warning">
- This old browser is unsupported and will most likely display funky
- things.
- </div>
- <![endif]-->
-
-
-
- <nav class="sidebar">
- <div class="sidebar-menu">&#9776;</div>
-
- <p class='location'>Struct ParsedContentDisposition</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.disposition">disposition</a><a href="#structfield.params">params</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='index.html'>mailparse</a></p><script>window.sidebarCurrent = {name: 'ParsedContentDisposition', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
- </nav>
-
- <div class="theme-picker">
- <button id="theme-picker" aria-label="Pick another theme!">
- <img src="../brush.svg" width="18" alt="Pick another theme!">
- </button>
- <div id="theme-choices"></div>
- </div>
- <script src="../theme.js"></script>
- <nav class="sub">
- <form class="search-form js-only">
- <div class="search-container">
- <input class="search-input" name="search"
- autocomplete="off"
- placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
- type="search">
- </div>
- </form>
- </nav>
-
- <section id='main' class="content"><h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>mailparse</a>::<wbr><a class="struct" href=''>ParsedContentDisposition</a></span><span class='out-of-band'><span id='render-detail'>
- <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
- [<span class='inner'>&#x2212;</span>]
- </a>
- </span><a class='srclink' href='../src/mailparse/lib.rs.html#607-615' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct ParsedContentDisposition {
- pub disposition: <a class="enum" href="../mailparse/enum.DispositionType.html" title="enum mailparse::DispositionType">DispositionType</a>,
- pub params: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/btree/map/struct.BTreeMap.html" title="struct alloc::btree::map::BTreeMap">BTreeMap</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;,
-}</pre></div><div class='docblock'><p>A struct to hold a more structured representation of the Content-Disposition header.
-This is provided mostly as a convenience since this metadata is usually
-needed to interpret the message body properly.</p>
-</div><h2 id='fields' class='fields small-section-header'>
- Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.disposition" class="structfield small-section-header">
- <a href="#structfield.disposition" class="anchor field"></a>
- <span id="disposition.v" class='invisible'>
- <code>disposition: <a class="enum" href="../mailparse/enum.DispositionType.html" title="enum mailparse::DispositionType">DispositionType</a></code>
- </span></span><div class='docblock'><p>The disposition type of the Content-Disposition header. If this
-is an extension type, the string will be lowercased.</p>
-</div><span id="structfield.params" class="structfield small-section-header">
- <a href="#structfield.params" class="anchor field"></a>
- <span id="params.v" class='invisible'>
- <code>params: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/btree/map/struct.BTreeMap.html" title="struct alloc::btree::map::BTreeMap">BTreeMap</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;</code>
- </span></span><div class='docblock'><p>The additional params of Content-Disposition, e.g. filename. The
-keys in the map will be lowercased, and the values will have any
-enclosing quotes stripped.</p>
-</div>
- <h2 id='implementations' class='small-section-header'>
- Trait Implementations<a href='#implementations' class='anchor'></a>
- </h2>
- <div id='implementations-list'>
- <h3 id='impl-Debug' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../mailparse/struct.ParsedContentDisposition.html" title="struct mailparse::ParsedContentDisposition">ParsedContentDisposition</a></code><a href='#impl-Debug' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#606' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#606' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Default' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../mailparse/struct.ParsedContentDisposition.html" title="struct mailparse::ParsedContentDisposition">ParsedContentDisposition</a></code><a href='#impl-Default' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#606' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.default' class="method"><span id='default.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -&gt; <a class="struct" href="../mailparse/struct.ParsedContentDisposition.html" title="struct mailparse::ParsedContentDisposition">ParsedContentDisposition</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#606' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the &quot;default value&quot; for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
-</div></div></div>
- <h2 id='synthetic-implementations' class='small-section-header'>
- Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
- </h2>
- <div id='synthetic-implementations-list'>
- <h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../mailparse/struct.ParsedContentDisposition.html" title="struct mailparse::ParsedContentDisposition">ParsedContentDisposition</a></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../mailparse/struct.ParsedContentDisposition.html" title="struct mailparse::ParsedContentDisposition">ParsedContentDisposition</a></code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div></div></section>
- <section id='search' class="content hidden"></section>
-
- <section class="footer"></section>
-
- <aside id="help" class="hidden">
- <div>
- <h1 class="hidden">Help</h1>
-
- <div class="shortcuts">
- <h2>Keyboard Shortcuts</h2>
-
- <dl>
- <dt><kbd>?</kbd></dt>
- <dd>Show this help dialog</dd>
- <dt><kbd>S</kbd></dt>
- <dd>Focus the search field</dd>
- <dt><kbd>↑</kbd></dt>
- <dd>Move up in search results</dd>
- <dt><kbd>↓</kbd></dt>
- <dd>Move down in search results</dd>
- <dt><kbd>↹</kbd></dt>
- <dd>Switch tab</dd>
- <dt><kbd>&#9166;</kbd></dt>
- <dd>Go to active search result</dd>
- <dt><kbd>+</kbd></dt>
- <dd>Expand all sections</dd>
- <dt><kbd>-</kbd></dt>
- <dd>Collapse all sections</dd>
- </dl>
- </div>
-
- <div class="infos">
- <h2>Search Tricks</h2>
-
- <p>
- Prefix searches with a type followed by a colon (e.g.
- <code>fn:</code>) to restrict the search to a given type.
- </p>
-
- <p>
- Accepted types are: <code>fn</code>, <code>mod</code>,
- <code>struct</code>, <code>enum</code>,
- <code>trait</code>, <code>type</code>, <code>macro</code>,
- and <code>const</code>.
- </p>
-
- <p>
- Search functions by type signature (e.g.
- <code>vec -> usize</code> or <code>* -> vec</code>)
- </p>
- </div>
- </div>
- </aside>
-
-
-
- <script>
- window.rootPath = "../";
- window.currentCrate = "mailparse";
- </script>
- <script src="../main.js"></script>
- <script defer src="../search-index.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/struct.ParsedContentType.html b/target/doc/mailparse/struct.ParsedContentType.html
deleted file mode 100644
index 709f70d..0000000
--- a/target/doc/mailparse/struct.ParsedContentType.html
+++ /dev/null
@@ -1,164 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="generator" content="rustdoc">
- <meta name="description" content="API documentation for the Rust `ParsedContentType` struct in crate `mailparse`.">
- <meta name="keywords" content="rust, rustlang, rust-lang, ParsedContentType">
-
- <title>mailparse::ParsedContentType - Rust</title>
-
- <link rel="stylesheet" type="text/css" href="../normalize.css">
- <link rel="stylesheet" type="text/css" href="../rustdoc.css"
- id="mainThemeStyle">
-
- <link rel="stylesheet" type="text/css" href="../dark.css">
- <link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle">
- <script src="../storage.js"></script>
-
-
-
-
-</head>
-<body class="rustdoc struct">
- <!--[if lte IE 8]>
- <div class="warning">
- This old browser is unsupported and will most likely display funky
- things.
- </div>
- <![endif]-->
-
-
-
- <nav class="sidebar">
- <div class="sidebar-menu">&#9776;</div>
-
- <p class='location'>Struct ParsedContentType</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.mimetype">mimetype</a><a href="#structfield.charset">charset</a><a href="#structfield.params">params</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a><a href="#impl-Default">Default</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='index.html'>mailparse</a></p><script>window.sidebarCurrent = {name: 'ParsedContentType', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
- </nav>
-
- <div class="theme-picker">
- <button id="theme-picker" aria-label="Pick another theme!">
- <img src="../brush.svg" width="18" alt="Pick another theme!">
- </button>
- <div id="theme-choices"></div>
- </div>
- <script src="../theme.js"></script>
- <nav class="sub">
- <form class="search-form js-only">
- <div class="search-container">
- <input class="search-input" name="search"
- autocomplete="off"
- placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
- type="search">
- </div>
- </form>
- </nav>
-
- <section id='main' class="content"><h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>mailparse</a>::<wbr><a class="struct" href=''>ParsedContentType</a></span><span class='out-of-band'><span id='render-detail'>
- <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
- [<span class='inner'>&#x2212;</span>]
- </a>
- </span><a class='srclink' href='../src/mailparse/lib.rs.html#496-506' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct ParsedContentType {
- pub mimetype: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
- pub charset: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
- pub params: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/btree/map/struct.BTreeMap.html" title="struct alloc::btree::map::BTreeMap">BTreeMap</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;,
-}</pre></div><div class='docblock'><p>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.</p>
-</div><h2 id='fields' class='fields small-section-header'>
- Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.mimetype" class="structfield small-section-header">
- <a href="#structfield.mimetype" class="anchor field"></a>
- <span id="mimetype.v" class='invisible'>
- <code>mimetype: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code>
- </span></span><div class='docblock'><p>The type of the data, for example &quot;text/plain&quot; or &quot;application/pdf&quot;.</p>
-</div><span id="structfield.charset" class="structfield small-section-header">
- <a href="#structfield.charset" class="anchor field"></a>
- <span id="charset.v" class='invisible'>
- <code>charset: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code>
- </span></span><div class='docblock'><p>The charset used to decode the raw byte data, for example &quot;iso-8859-1&quot;
-or &quot;utf-8&quot;.</p>
-</div><span id="structfield.params" class="structfield small-section-header">
- <a href="#structfield.params" class="anchor field"></a>
- <span id="params.v" class='invisible'>
- <code>params: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/btree/map/struct.BTreeMap.html" title="struct alloc::btree::map::BTreeMap">BTreeMap</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;</code>
- </span></span><div class='docblock'><p>The additional params of Content-Type, e.g. filename and boundary. The
-keys in the map will be lowercased, and the values will have any
-enclosing quotes stripped.</p>
-</div>
- <h2 id='implementations' class='small-section-header'>
- Trait Implementations<a href='#implementations' class='anchor'></a>
- </h2>
- <div id='implementations-list'>
- <h3 id='impl-Debug' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../mailparse/struct.ParsedContentType.html" title="struct mailparse::ParsedContentType">ParsedContentType</a></code><a href='#impl-Debug' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#495' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#495' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div><h3 id='impl-Default' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html" title="trait core::default::Default">Default</a> for <a class="struct" href="../mailparse/struct.ParsedContentType.html" title="struct mailparse::ParsedContentType">ParsedContentType</a></code><a href='#impl-Default' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#508-516' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.default' class="method"><span id='default.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default' class='fnname'>default</a>() -&gt; Self</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#509-515' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns the &quot;default value&quot; for a type. <a href="https://doc.rust-lang.org/nightly/core/default/trait.Default.html#tymethod.default">Read more</a></p>
-</div></div></div>
- <h2 id='synthetic-implementations' class='small-section-header'>
- Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
- </h2>
- <div id='synthetic-implementations-list'>
- <h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../mailparse/struct.ParsedContentType.html" title="struct mailparse::ParsedContentType">ParsedContentType</a></code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../mailparse/struct.ParsedContentType.html" title="struct mailparse::ParsedContentType">ParsedContentType</a></code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div></div></section>
- <section id='search' class="content hidden"></section>
-
- <section class="footer"></section>
-
- <aside id="help" class="hidden">
- <div>
- <h1 class="hidden">Help</h1>
-
- <div class="shortcuts">
- <h2>Keyboard Shortcuts</h2>
-
- <dl>
- <dt><kbd>?</kbd></dt>
- <dd>Show this help dialog</dd>
- <dt><kbd>S</kbd></dt>
- <dd>Focus the search field</dd>
- <dt><kbd>↑</kbd></dt>
- <dd>Move up in search results</dd>
- <dt><kbd>↓</kbd></dt>
- <dd>Move down in search results</dd>
- <dt><kbd>↹</kbd></dt>
- <dd>Switch tab</dd>
- <dt><kbd>&#9166;</kbd></dt>
- <dd>Go to active search result</dd>
- <dt><kbd>+</kbd></dt>
- <dd>Expand all sections</dd>
- <dt><kbd>-</kbd></dt>
- <dd>Collapse all sections</dd>
- </dl>
- </div>
-
- <div class="infos">
- <h2>Search Tricks</h2>
-
- <p>
- Prefix searches with a type followed by a colon (e.g.
- <code>fn:</code>) to restrict the search to a given type.
- </p>
-
- <p>
- Accepted types are: <code>fn</code>, <code>mod</code>,
- <code>struct</code>, <code>enum</code>,
- <code>trait</code>, <code>type</code>, <code>macro</code>,
- and <code>const</code>.
- </p>
-
- <p>
- Search functions by type signature (e.g.
- <code>vec -> usize</code> or <code>* -> vec</code>)
- </p>
- </div>
- </div>
- </aside>
-
-
-
- <script>
- window.rootPath = "../";
- window.currentCrate = "mailparse";
- </script>
- <script src="../main.js"></script>
- <script defer src="../search-index.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/struct.ParsedMail.html b/target/doc/mailparse/struct.ParsedMail.html
deleted file mode 100644
index 3d97dfd..0000000
--- a/target/doc/mailparse/struct.ParsedMail.html
+++ /dev/null
@@ -1,197 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="generator" content="rustdoc">
- <meta name="description" content="API documentation for the Rust `ParsedMail` struct in crate `mailparse`.">
- <meta name="keywords" content="rust, rustlang, rust-lang, ParsedMail">
-
- <title>mailparse::ParsedMail - Rust</title>
-
- <link rel="stylesheet" type="text/css" href="../normalize.css">
- <link rel="stylesheet" type="text/css" href="../rustdoc.css"
- id="mainThemeStyle">
-
- <link rel="stylesheet" type="text/css" href="../dark.css">
- <link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle">
- <script src="../storage.js"></script>
-
-
-
-
-</head>
-<body class="rustdoc struct">
- <!--[if lte IE 8]>
- <div class="warning">
- This old browser is unsupported and will most likely display funky
- things.
- </div>
- <![endif]-->
-
-
-
- <nav class="sidebar">
- <div class="sidebar-menu">&#9776;</div>
-
- <p class='location'>Struct ParsedMail</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#fields">Fields</a><div class="sidebar-links"><a href="#structfield.headers">headers</a><a href="#structfield.ctype">ctype</a><a href="#structfield.subparts">subparts</a></div><a class="sidebar-title" href="#methods">Methods</a><div class="sidebar-links"><a href="#method.get_body">get_body</a><a href="#method.get_body_raw">get_body_raw</a><a href="#method.get_content_disposition">get_content_disposition</a></div><a class="sidebar-title" href="#implementations">Trait Implementations</a><div class="sidebar-links"><a href="#impl-Debug">Debug</a></div><a class="sidebar-title" href="#synthetic-implementations">Auto Trait Implementations</a><div class="sidebar-links"><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a></div></div><p class='location'><a href='index.html'>mailparse</a></p><script>window.sidebarCurrent = {name: 'ParsedMail', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
- </nav>
-
- <div class="theme-picker">
- <button id="theme-picker" aria-label="Pick another theme!">
- <img src="../brush.svg" width="18" alt="Pick another theme!">
- </button>
- <div id="theme-choices"></div>
- </div>
- <script src="../theme.js"></script>
- <nav class="sub">
- <form class="search-form js-only">
- <div class="search-container">
- <input class="search-input" name="search"
- autocomplete="off"
- placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
- type="search">
- </div>
- </form>
- </nav>
-
- <section id='main' class="content"><h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>mailparse</a>::<wbr><a class="struct" href=''>ParsedMail</a></span><span class='out-of-band'><span id='render-detail'>
- <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
- [<span class='inner'>&#x2212;</span>]
- </a>
- </span><a class='srclink' href='../src/mailparse/lib.rs.html#646-656' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust struct'>pub struct ParsedMail&lt;'a&gt; {
- pub headers: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="../mailparse/struct.MailHeader.html" title="struct mailparse::MailHeader">MailHeader</a>&lt;'a&gt;&gt;,
- pub ctype: <a class="struct" href="../mailparse/struct.ParsedContentType.html" title="struct mailparse::ParsedContentType">ParsedContentType</a>,
- pub subparts: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="../mailparse/struct.ParsedMail.html" title="struct mailparse::ParsedMail">ParsedMail</a>&lt;'a&gt;&gt;,
- // some fields omitted
-}</pre></div><div class='docblock'><p>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.</p>
-</div><h2 id='fields' class='fields small-section-header'>
- Fields<a href='#fields' class='anchor'></a></h2><span id="structfield.headers" class="structfield small-section-header">
- <a href="#structfield.headers" class="anchor field"></a>
- <span id="headers.v" class='invisible'>
- <code>headers: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="../mailparse/struct.MailHeader.html" title="struct mailparse::MailHeader">MailHeader</a>&lt;'a&gt;&gt;</code>
- </span></span><div class='docblock'><p>The headers for the message (or message subpart).</p>
-</div><span id="structfield.ctype" class="structfield small-section-header">
- <a href="#structfield.ctype" class="anchor field"></a>
- <span id="ctype.v" class='invisible'>
- <code>ctype: <a class="struct" href="../mailparse/struct.ParsedContentType.html" title="struct mailparse::ParsedContentType">ParsedContentType</a></code>
- </span></span><div class='docblock'><p>The Content-Type information for the message (or message subpart).</p>
-</div><span id="structfield.subparts" class="structfield small-section-header">
- <a href="#structfield.subparts" class="anchor field"></a>
- <span id="subparts.v" class='invisible'>
- <code>subparts: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="../mailparse/struct.ParsedMail.html" title="struct mailparse::ParsedMail">ParsedMail</a>&lt;'a&gt;&gt;</code>
- </span></span><div class='docblock'><p>The subparts of this message or subpart. This vector is only non-empty
-if ctype.mimetype starts with &quot;multipart/&quot;.</p>
-</div>
- <h2 id='methods' class='small-section-header'>
- Methods<a href='#methods' class='anchor'></a>
- </h2>
- <h3 id='impl' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a&gt; <a class="struct" href="../mailparse/struct.ParsedMail.html" title="struct mailparse::ParsedMail">ParsedMail</a>&lt;'a&gt;</code><a href='#impl' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#658-736' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.get_body' class="method"><span id='get_body.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_body' class='fnname'>get_body</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>, <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#674-683' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Get the body of the message as a Rust string. This function tries to
-unapply the Content-Transfer-Encoding if there is one, and then converts
-the result into a Rust UTF-8 string using the charset in the Content-Type
-(or &quot;us-ascii&quot; if the charset was missing or not recognized).</p>
-<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
-<pre class="rust rust-example-rendered">
- <span class="kw">use</span> <span class="ident">mailparse</span>::<span class="ident">parse_mail</span>;
- <span class="kw">let</span> <span class="ident">p</span> <span class="op">=</span> <span class="ident">parse_mail</span>(<span class="macro">concat</span><span class="macro">!</span>(
- <span class="string">&quot;Subject: test\n&quot;</span>,
- <span class="string">&quot;\n&quot;</span>,
- <span class="string">&quot;This is the body&quot;</span>).<span class="ident">as_bytes</span>())
- .<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">p</span>.<span class="ident">get_body</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;This is the body&quot;</span>);</pre>
-</div><h4 id='method.get_body_raw' class="method"><span id='get_body_raw.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_body_raw' class='fnname'>get_body_raw</a>(&amp;self) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>&gt;, <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#699-722' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Get the body of the message as a Rust Vec<u8>. This function tries to
-unapply the Content-Transfer-Encoding if there is one, but won't do
-any charset decoding.</p>
-<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
-<pre class="rust rust-example-rendered">
- <span class="kw">use</span> <span class="ident">mailparse</span>::<span class="ident">parse_mail</span>;
- <span class="kw">let</span> <span class="ident">p</span> <span class="op">=</span> <span class="ident">parse_mail</span>(<span class="macro">concat</span><span class="macro">!</span>(
- <span class="string">&quot;Subject: test\n&quot;</span>,
- <span class="string">&quot;\n&quot;</span>,
- <span class="string">&quot;This is the body&quot;</span>).<span class="ident">as_bytes</span>())
- .<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">p</span>.<span class="ident">get_body_raw</span>().<span class="ident">unwrap</span>(), <span class="string">b&quot;This is the body&quot;</span>);</pre>
-</div><h4 id='method.get_content_disposition' class="method"><span id='get_content_disposition.v' class='invisible'><table class='table-display'><tbody><tr><td><code>pub fn <a href='#method.get_content_disposition' class='fnname'>get_content_disposition</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self<br>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="../mailparse/struct.ParsedContentDisposition.html" title="struct mailparse::ParsedContentDisposition">ParsedContentDisposition</a>, <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#729-735' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Returns a struct containing a parsed representation of the
-Content-Disposition header. The first header with this name
-is used, if there are multiple. See the <code>parse_content_disposition</code>
-method documentation for more details on the semantics of the
-returned object.</p>
-</div></div>
- <h2 id='implementations' class='small-section-header'>
- Trait Implementations<a href='#implementations' class='anchor'></a>
- </h2>
- <div id='implementations-list'>
- <h3 id='impl-Debug' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../mailparse/struct.ParsedMail.html" title="struct mailparse::ParsedMail">ParsedMail</a>&lt;'a&gt;</code><a href='#impl-Debug' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#645' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#645' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
-</div></div></div>
- <h2 id='synthetic-implementations' class='small-section-header'>
- Auto Trait Implementations<a href='#synthetic-implementations' class='anchor'></a>
- </h2>
- <div id='synthetic-implementations-list'>
- <h3 id='impl-Send' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="../mailparse/struct.ParsedMail.html" title="struct mailparse::ParsedMail">ParsedMail</a>&lt;'a&gt;</code><a href='#impl-Send' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div><h3 id='impl-Sync' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="../mailparse/struct.ParsedMail.html" title="struct mailparse::ParsedMail">ParsedMail</a>&lt;'a&gt;</code><a href='#impl-Sync' class='anchor'></a></span></td><td><span class='out-of-band'></span></td></tr></tbody></table></h3><div class='impl-items'></div></div></section>
- <section id='search' class="content hidden"></section>
-
- <section class="footer"></section>
-
- <aside id="help" class="hidden">
- <div>
- <h1 class="hidden">Help</h1>
-
- <div class="shortcuts">
- <h2>Keyboard Shortcuts</h2>
-
- <dl>
- <dt><kbd>?</kbd></dt>
- <dd>Show this help dialog</dd>
- <dt><kbd>S</kbd></dt>
- <dd>Focus the search field</dd>
- <dt><kbd>↑</kbd></dt>
- <dd>Move up in search results</dd>
- <dt><kbd>↓</kbd></dt>
- <dd>Move down in search results</dd>
- <dt><kbd>↹</kbd></dt>
- <dd>Switch tab</dd>
- <dt><kbd>&#9166;</kbd></dt>
- <dd>Go to active search result</dd>
- <dt><kbd>+</kbd></dt>
- <dd>Expand all sections</dd>
- <dt><kbd>-</kbd></dt>
- <dd>Collapse all sections</dd>
- </dl>
- </div>
-
- <div class="infos">
- <h2>Search Tricks</h2>
-
- <p>
- Prefix searches with a type followed by a colon (e.g.
- <code>fn:</code>) to restrict the search to a given type.
- </p>
-
- <p>
- Accepted types are: <code>fn</code>, <code>mod</code>,
- <code>struct</code>, <code>enum</code>,
- <code>trait</code>, <code>type</code>, <code>macro</code>,
- and <code>const</code>.
- </p>
-
- <p>
- Search functions by type signature (e.g.
- <code>vec -> usize</code> or <code>* -> vec</code>)
- </p>
- </div>
- </div>
- </aside>
-
-
-
- <script>
- window.rootPath = "../";
- window.currentCrate = "mailparse";
- </script>
- <script src="../main.js"></script>
- <script defer src="../search-index.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/mailparse/trait.MailHeaderMap.html b/target/doc/mailparse/trait.MailHeaderMap.html
deleted file mode 100644
index 0d9fc06..0000000
--- a/target/doc/mailparse/trait.MailHeaderMap.html
+++ /dev/null
@@ -1,174 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="generator" content="rustdoc">
- <meta name="description" content="API documentation for the Rust `MailHeaderMap` trait in crate `mailparse`.">
- <meta name="keywords" content="rust, rustlang, rust-lang, MailHeaderMap">
-
- <title>mailparse::MailHeaderMap - Rust</title>
-
- <link rel="stylesheet" type="text/css" href="../normalize.css">
- <link rel="stylesheet" type="text/css" href="../rustdoc.css"
- id="mainThemeStyle">
-
- <link rel="stylesheet" type="text/css" href="../dark.css">
- <link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle">
- <script src="../storage.js"></script>
-
-
-
-
-</head>
-<body class="rustdoc trait">
- <!--[if lte IE 8]>
- <div class="warning">
- This old browser is unsupported and will most likely display funky
- things.
- </div>
- <![endif]-->
-
-
-
- <nav class="sidebar">
- <div class="sidebar-menu">&#9776;</div>
-
- <p class='location'>Trait MailHeaderMap</p><div class="sidebar-elems"><div class="block items"><a class="sidebar-title" href="#required-methods">Required Methods</a><div class="sidebar-links"><a href="#tymethod.get_first_value">get_first_value</a><a href="#tymethod.get_all_values">get_all_values</a></div><a class="sidebar-title" href="#foreign-impls">Implementations on Foreign Types</a><div class="sidebar-links"><a href="#impl-MailHeaderMap">Vec&lt;MailHeader&lt;&#39;a&gt;&gt;</a></div><a class="sidebar-title" href="#implementors">Implementors</a></div><p class='location'><a href='index.html'>mailparse</a></p><script>window.sidebarCurrent = {name: 'MailHeaderMap', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script></div>
- </nav>
-
- <div class="theme-picker">
- <button id="theme-picker" aria-label="Pick another theme!">
- <img src="../brush.svg" width="18" alt="Pick another theme!">
- </button>
- <div id="theme-choices"></div>
- </div>
- <script src="../theme.js"></script>
- <nav class="sub">
- <form class="search-form js-only">
- <div class="search-container">
- <input class="search-input" name="search"
- autocomplete="off"
- placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
- type="search">
- </div>
- </form>
- </nav>
-
- <section id='main' class="content"><h1 class='fqn'><span class='in-band'>Trait <a href='index.html'>mailparse</a>::<wbr><a class="trait" href=''>MailHeaderMap</a></span><span class='out-of-band'><span id='render-detail'>
- <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
- [<span class='inner'>&#x2212;</span>]
- </a>
- </span><a class='srclink' href='../src/mailparse/lib.rs.html#385-419' title='goto source code'>[src]</a></span></h1><div class="docblock type-decl"><pre class='rust trait'>pub trait MailHeaderMap {
- fn <a href='#tymethod.get_first_value' class='fnname'>get_first_value</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;self, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;key: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a><br>&nbsp;&nbsp;&nbsp;&nbsp;) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;, <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a>&gt;;
-<div class='item-spacer'></div> fn <a href='#tymethod.get_all_values' class='fnname'>get_all_values</a>(&amp;self, key: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;, <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a>&gt;;
-}</pre></div><div class='docblock'><p>A trait that is implemented by the Vec<MailHeader> returned by the parse_headers
-function. It provides a map-like interface to look up header values by their
-name.</p>
-</div>
- <h2 id='required-methods' class='small-section-header'>
- Required Methods<a href='#required-methods' class='anchor'></a>
- </h2>
- <div class='methods'>
- <h3 id='tymethod.get_first_value' class='method'><span id='get_first_value.v' class='invisible'><code>fn <a href='#tymethod.get_first_value' class='fnname'>get_first_value</a>(&amp;self, key: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;, <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a>&gt;</code></span></h3><div class='docblock'><p>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 names are matched case-insensitively.</p>
-<h1 id="examples" class="section-header"><a href="#examples">Examples</a></h1>
-<pre class="rust rust-example-rendered">
- <span class="kw">use</span> <span class="ident">mailparse</span>::{<span class="ident">parse_mail</span>, <span class="ident">MailHeaderMap</span>};
- <span class="kw">let</span> <span class="ident">headers</span> <span class="op">=</span> <span class="ident">parse_mail</span>(<span class="macro">concat</span><span class="macro">!</span>(
- <span class="string">&quot;Subject: Test\n&quot;</span>,
- <span class="string">&quot;\n&quot;</span>,
- <span class="string">&quot;This is a test message&quot;</span>).<span class="ident">as_bytes</span>())
- .<span class="ident">unwrap</span>().<span class="ident">headers</span>;
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">headers</span>.<span class="ident">get_first_value</span>(<span class="string">&quot;Subject&quot;</span>).<span class="ident">unwrap</span>(), <span class="prelude-val">Some</span>(<span class="string">&quot;Test&quot;</span>.<span class="ident">to_string</span>()));</pre>
-</div><h3 id='tymethod.get_all_values' class='method'><span id='get_all_values.v' class='invisible'><code>fn <a href='#tymethod.get_all_values' class='fnname'>get_all_values</a>(&amp;self, key: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;, <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a>&gt;</code></span></h3><div class='docblock'><p>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. Header names are matched
-case-insensitively.</p>
-<h1 id="examples-1" class="section-header"><a href="#examples-1">Examples</a></h1>
-<pre class="rust rust-example-rendered">
- <span class="kw">use</span> <span class="ident">mailparse</span>::{<span class="ident">parse_mail</span>, <span class="ident">MailHeaderMap</span>};
- <span class="kw">let</span> <span class="ident">headers</span> <span class="op">=</span> <span class="ident">parse_mail</span>(<span class="macro">concat</span><span class="macro">!</span>(
- <span class="string">&quot;Key: Value1\n&quot;</span>,
- <span class="string">&quot;Key: Value2&quot;</span>).<span class="ident">as_bytes</span>())
- .<span class="ident">unwrap</span>().<span class="ident">headers</span>;
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">headers</span>.<span class="ident">get_all_values</span>(<span class="string">&quot;Key&quot;</span>).<span class="ident">unwrap</span>(),
- <span class="macro">vec</span><span class="macro">!</span>[<span class="string">&quot;Value1&quot;</span>.<span class="ident">to_string</span>(), <span class="string">&quot;Value2&quot;</span>.<span class="ident">to_string</span>()]);</pre>
-</div></div>
- <h2 id='foreign-impls' class='small-section-header'>
- Implementations on Foreign Types<a href='#foreign-impls' class='anchor'></a>
- </h2>
- <h3 id='impl-MailHeaderMap' class='impl'><span class='in-band'><table class='table-display'><tbody><tr><td><code>impl&lt;'a&gt; <a class="trait" href="../mailparse/trait.MailHeaderMap.html" title="trait mailparse::MailHeaderMap">MailHeaderMap</a> for <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="../mailparse/struct.MailHeader.html" title="struct mailparse::MailHeader">MailHeader</a>&lt;'a&gt;&gt;</code><a href='#impl-MailHeaderMap' class='anchor'></a></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#421-440' title='goto source code'>[src]</a></span></td></tr></tbody></table></h3><span class='docblock autohide'><div class='impl-items'><h4 id='method.get_first_value' class="method"><span id='get_first_value.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.get_first_value' class='fnname'>get_first_value</a>(&amp;self, key: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;, <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#422-429' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4><h4 id='method.get_all_values' class="method"><span id='get_all_values.v-1' class='invisible'><table class='table-display'><tbody><tr><td><code>fn <a href='#method.get_all_values' class='fnname'>get_all_values</a>(&amp;self, key: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>&gt;, <a class="enum" href="../mailparse/enum.MailParseError.html" title="enum mailparse::MailParseError">MailParseError</a>&gt;</code></span></td><td><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/mailparse/lib.rs.html#431-439' title='goto source code'>[src]</a></td></tr></tbody></table></span></h4></div></span>
- <h2 id='implementors' class='small-section-header'>
- Implementors<a href='#implementors' class='anchor'></a>
- </h2>
- <ul class='item-list' id='implementors-list'>
- </ul><script type="text/javascript">window.inlined_types=new Set([]);</script><script type="text/javascript" async
- src="../implementors/mailparse/trait.MailHeaderMap.js">
- </script></section>
- <section id='search' class="content hidden"></section>
-
- <section class="footer"></section>
-
- <aside id="help" class="hidden">
- <div>
- <h1 class="hidden">Help</h1>
-
- <div class="shortcuts">
- <h2>Keyboard Shortcuts</h2>
-
- <dl>
- <dt><kbd>?</kbd></dt>
- <dd>Show this help dialog</dd>
- <dt><kbd>S</kbd></dt>
- <dd>Focus the search field</dd>
- <dt><kbd>↑</kbd></dt>
- <dd>Move up in search results</dd>
- <dt><kbd>↓</kbd></dt>
- <dd>Move down in search results</dd>
- <dt><kbd>↹</kbd></dt>
- <dd>Switch tab</dd>
- <dt><kbd>&#9166;</kbd></dt>
- <dd>Go to active search result</dd>
- <dt><kbd>+</kbd></dt>
- <dd>Expand all sections</dd>
- <dt><kbd>-</kbd></dt>
- <dd>Collapse all sections</dd>
- </dl>
- </div>
-
- <div class="infos">
- <h2>Search Tricks</h2>
-
- <p>
- Prefix searches with a type followed by a colon (e.g.
- <code>fn:</code>) to restrict the search to a given type.
- </p>
-
- <p>
- Accepted types are: <code>fn</code>, <code>mod</code>,
- <code>struct</code>, <code>enum</code>,
- <code>trait</code>, <code>type</code>, <code>macro</code>,
- and <code>const</code>.
- </p>
-
- <p>
- Search functions by type signature (e.g.
- <code>vec -> usize</code> or <code>* -> vec</code>)
- </p>
- </div>
- </div>
- </aside>
-
-
-
- <script>
- window.rootPath = "../";
- window.currentCrate = "mailparse";
- </script>
- <script src="../main.js"></script>
- <script defer src="../search-index.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/main.css b/target/doc/main.css
deleted file mode 100644
index 42d0ec7..0000000
--- a/target/doc/main.css
+++ /dev/null
@@ -1,237 +0,0 @@
-/**
- * Copyright 2015 The Rust Project Developers. See the COPYRIGHT
- * file at the top-level directory of this distribution and at
- * http://rust-lang.org/COPYRIGHT.
- *
- * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
- * http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
- * <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
- * option. This file may not be copied, modified, or distributed
- * except according to those terms.
- */
-
-/* General structure and fonts */
-
-body {
- background-color: white;
- color: black;
-}
-
-h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
- color: black;
-}
-h1.fqn {
- border-bottom-color: #D5D5D5;
-}
-h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod) {
- border-bottom-color: #DDDDDD;
-}
-
-.in-band {
- background-color: white;
-}
-
-.docblock code, .docblock-short code {
- background-color: #F5F5F5;
-}
-pre {
- background-color: #F5F5F5;
-}
-
-.sidebar {
- background-color: #F1F1F1;
-}
-
-.sidebar .current {
- background-color: #fff;
-}
-
-.source .sidebar {
- background-color: #fff;
-}
-
-.sidebar .location {
- border-color: #000;
- background-color: #fff;
- color: #333;
-}
-
-.block a:hover {
- background: #F5F5F5;
-}
-
-.line-numbers span { color: #c67e2d; }
-.line-numbers .line-highlighted {
- background-color: #f6fdb0 !important;
-}
-
-.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
- border-bottom-color: #DDD;
-}
-
-.docblock table {
- border-color: #ddd;
-}
-
-.docblock table td {
- border-top-color: #ddd;
- border-bottom-color: #ddd;
-}
-
-.docblock table th {
- border-top-color: #ddd;
- border-bottom-color: #ddd;
-}
-
-:target { background: #FDFFD3; }
-
-:target > .in-band {
- background: #FDFFD3;
-}
-
-.content .highlighted {
- color: #000 !important;
- background-color: #ccc;
-}
-.content .highlighted a, .content .highlighted span { color: #000 !important; }
-.content .highlighted.trait { background-color: #c7b6ff; }
-.content .highlighted.mod,
-.content .highlighted.externcrate { background-color: #afc6e4; }
-.content .highlighted.enum { background-color: #b4d1b9; }
-.content .highlighted.struct { background-color: #e7b1a0; }
-.content .highlighted.union { background-color: #b7bd49; }
-.content .highlighted.fn,
-.content .highlighted.method,
-.content .highlighted.tymethod { background-color: #c6afb3; }
-.content .highlighted.type { background-color: #ffc891; }
-.content .highlighted.macro { background-color: #8ce488; }
-.content .highlighted.constant,
-.content .highlighted.static { background-color: #c3e0ff; }
-.content .highlighted.primitive { background-color: #9aecff; }
-
-.content span.enum, .content a.enum, .block a.current.enum { color: #508157; }
-.content span.struct, .content a.struct, .block a.current.struct { color: #df3600; }
-.content span.type, .content a.type, .block a.current.type { color: #ba5d00; }
-.content span.macro, .content a.macro, .block a.current.macro { color: #068000; }
-.content span.union, .content a.union, .block a.current.union { color: #767b27; }
-.content span.constant, .content a.constant, .block a.current.constant,
-.content span.static, .content a.static, .block a.current.static { color: #546e8a; }
-.content span.primitive, .content a.primitive, .block a.current.primitive { color: #2c8093; }
-.content span.externcrate,
-.content span.mod, .content a.mod, .block a.current.mod { color: #4d76ae; }
-.content span.trait, .content a.trait, .block a.current.trait { color: #7c5af3; }
-.content span.fn, .content a.fn, .block a.current.fn,
-.content span.method, .content a.method, .block a.current.method,
-.content span.tymethod, .content a.tymethod, .block a.current.tymethod,
-.content .fnname { color: #9a6e31; }
-
-pre.rust .comment { color: #8E908C; }
-pre.rust .doccomment { color: #4D4D4C; }
-
-nav {
- border-bottom-color: #e0e0e0;
-}
-nav.main .current {
- border-top-color: #000;
- border-bottom-color: #000;
-}
-nav.main .separator {
- border: 1px solid #000;
-}
-a {
- color: #000;
-}
-
-.docblock a, .docblock-short a, .stability a {
- color: #3873AD;
-}
-
-a.test-arrow {
- color: #f5f5f5;
-}
-
-.search-input {
- color: #555;
- box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent;
- background-color: white;
-}
-
-.stab.unstable { background: #FFF5D6; border-color: #FFC600; }
-.stab.deprecated { background: #F3DFFF; border-color: #7F0087; }
-.stab.portability { background: #C4ECFF; border-color: #7BA5DB; }
-
-#help > div {
- background: #e9e9e9;
- border-color: #bfbfbf;;
-}
-
-#help dt {
- border-color: #bfbfbf;
- background: #fff;
-}
-
-.since {
- color: grey;
-}
-
-.line-numbers :target { background-color: transparent; }
-
-/* Code highlighting */
-pre.rust .kw { color: #8959A8; }
-pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
-pre.rust .number, pre.rust .string { color: #718C00; }
-pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val,
-pre.rust .attribute, pre.rust .attribute .ident { color: #C82829; }
-pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
-pre.rust .lifetime { color: #B76514; }
-pre.rust .question-mark {
- color: #ff9011;
-}
-
-a.test-arrow {
- background-color: rgba(78, 139, 202, 0.2);
-}
-
-a.test-arrow:hover{
- background-color: #4e8bca;
-}
-
-.toggle-label {
- color: #999;
-}
-
-:target > code {
- background: #FDFFD3;
-}
-
-pre.compile_fail {
- border-left: 2px solid rgba(255,0,0,.4);
-}
-
-pre.compile_fail:hover, .information:hover + pre.compile_fail {
- border-left: 2px solid #f00;
-}
-
-pre.ignore {
- border-left: 2px solid rgba(255,142,0,.4);
-}
-
-pre.ignore:hover, .information:hover + pre.ignore {
- border-left: 2px solid #ff9200;
-}
-
-.tooltip.compile_fail {
- color: rgba(255,0,0,.3);
-}
-
-.information > .compile_fail:hover {
- color: #f00;
-}
-
-.tooltip.ignore {
- color: rgba(255,142,0,.3);
-}
-
-.information > .ignore:hover {
- color: rgba(255,142,0,1);
-}
diff --git a/target/doc/main.js b/target/doc/main.js
deleted file mode 100644
index 3c115e2..0000000
--- a/target/doc/main.js
+++ /dev/null
@@ -1,2045 +0,0 @@
-/*!
- * Copyright 2014 The Rust Project Developers. See the COPYRIGHT
- * file at the top-level directory of this distribution and at
- * http://rust-lang.org/COPYRIGHT.
- *
- * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
- * http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
- * <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
- * option. This file may not be copied, modified, or distributed
- * except according to those terms.
- */
-
-/*jslint browser: true, es5: true */
-/*globals $: true, rootPath: true */
-
-(function() {
- "use strict";
-
- // This mapping table should match the discriminants of
- // `rustdoc::html::item_type::ItemType` type in Rust.
- var itemTypes = ["mod",
- "externcrate",
- "import",
- "struct",
- "enum",
- "fn",
- "type",
- "static",
- "trait",
- "impl",
- "tymethod",
- "method",
- "structfield",
- "variant",
- "macro",
- "primitive",
- "associatedtype",
- "constant",
- "associatedconstant",
- "union",
- "foreigntype"];
-
- // On the search screen, so you remain on the last tab you opened.
- //
- // 0 for "In Names"
- // 1 for "In Parameters"
- // 2 for "In Return Types"
- var currentTab = 0;
-
- var themesWidth = null;
-
- if (!String.prototype.startsWith) {
- String.prototype.startsWith = function(searchString, position) {
- position = position || 0;
- return this.indexOf(searchString, position) === position;
- };
- }
-
- function hasClass(elem, className) {
- if (elem && className && elem.className) {
- var elemClass = elem.className;
- var start = elemClass.indexOf(className);
- if (start === -1) {
- return false;
- } else if (elemClass.length === className.length) {
- return true;
- } else {
- if (start > 0 && elemClass[start - 1] !== ' ') {
- return false;
- }
- var end = start + className.length;
- if (end < elemClass.length && elemClass[end] !== ' ') {
- return false;
- }
- return true;
- }
- if (start > 0 && elemClass[start - 1] !== ' ') {
- return false;
- }
- var end = start + className.length;
- if (end < elemClass.length && elemClass[end] !== ' ') {
- return false;
- }
- return true;
- }
- return false;
- }
-
- function addClass(elem, className) {
- if (elem && className && !hasClass(elem, className)) {
- if (elem.className && elem.className.length > 0) {
- elem.className += ' ' + className;
- } else {
- elem.className = className;
- }
- }
- }
-
- function removeClass(elem, className) {
- if (elem && className && elem.className) {
- elem.className = (" " + elem.className + " ").replace(" " + className + " ", " ")
- .trim();
- }
- }
-
- function isHidden(elem) {
- return (elem.offsetParent === null)
- }
-
- function showSidebar() {
- var elems = document.getElementsByClassName("sidebar-elems")[0];
- if (elems) {
- addClass(elems, "show-it");
- }
- var sidebar = document.getElementsByClassName('sidebar')[0];
- if (sidebar) {
- addClass(sidebar, 'mobile');
- var filler = document.getElementById("sidebar-filler");
- if (!filler) {
- var div = document.createElement("div");
- div.id = "sidebar-filler";
- sidebar.appendChild(div);
- }
- }
- var themePicker = document.getElementsByClassName("theme-picker");
- if (themePicker && themePicker.length > 0) {
- themePicker[0].style.display = "none";
- }
- }
-
- function hideSidebar() {
- var elems = document.getElementsByClassName("sidebar-elems")[0];
- if (elems) {
- removeClass(elems, "show-it");
- }
- var sidebar = document.getElementsByClassName('sidebar')[0];
- removeClass(sidebar, 'mobile');
- var filler = document.getElementById("sidebar-filler");
- if (filler) {
- filler.remove();
- }
- document.getElementsByTagName("body")[0].style.marginTop = '';
- var themePicker = document.getElementsByClassName("theme-picker");
- if (themePicker && themePicker.length > 0) {
- themePicker[0].style.display = null;
- }
- }
-
- // used for special search precedence
- var TY_PRIMITIVE = itemTypes.indexOf("primitive");
-
- onEach(document.getElementsByClassName('js-only'), function(e) {
- removeClass(e, 'js-only');
- });
-
- function getQueryStringParams() {
- var params = {};
- window.location.search.substring(1).split("&").
- map(function(s) {
- var pair = s.split("=");
- params[decodeURIComponent(pair[0])] =
- typeof pair[1] === "undefined" ? null : decodeURIComponent(pair[1]);
- });
- return params;
- }
-
- function browserSupportsHistoryApi() {
- return document.location.protocol != "file:" &&
- window.history && typeof window.history.pushState === "function";
- }
-
- function highlightSourceLines(ev) {
- // If we're in mobile mode, we should add the sidebar in any case.
- hideSidebar();
- var search = document.getElementById("search");
- var i, from, to, match = window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/);
- if (match) {
- from = parseInt(match[1], 10);
- to = Math.min(50000, parseInt(match[2] || match[1], 10));
- from = Math.min(from, to);
- var elem = document.getElementById(from);
- if (!elem) {
- return;
- }
- if (ev === null) {
- var x = document.getElementById(from);
- if (x) {
- x.scrollIntoView();
- }
- }
- onEach(document.getElementsByClassName('line-numbers'), function(e) {
- onEach(e.getElementsByTagName('span'), function(i_e) {
- removeClass(i_e, 'line-highlighted');
- });
- })
- for (i = from; i <= to; ++i) {
- addClass(document.getElementById(i), 'line-highlighted');
- }
- } else if (ev !== null && search && !hasClass(search, "hidden") && ev.newURL) {
- addClass(search, "hidden");
- removeClass(document.getElementById("main"), "hidden");
- var hash = ev.newURL.slice(ev.newURL.indexOf('#') + 1);
- if (browserSupportsHistoryApi()) {
- history.replaceState(hash, "", "?search=#" + hash);
- }
- var elem = document.getElementById(hash);
- if (elem) {
- elem.scrollIntoView();
- }
- }
- }
- highlightSourceLines(null);
- window.onhashchange = highlightSourceLines;
-
- // Gets the human-readable string for the virtual-key code of the
- // given KeyboardEvent, ev.
- //
- // This function is meant as a polyfill for KeyboardEvent#key,
- // since it is not supported in Trident. We also test for
- // KeyboardEvent#keyCode because the handleShortcut handler is
- // also registered for the keydown event, because Blink doesn't fire
- // keypress on hitting the Escape key.
- //
- // So I guess you could say things are getting pretty interoperable.
- function getVirtualKey(ev) {
- if ("key" in ev && typeof ev.key != "undefined")
- return ev.key;
-
- var c = ev.charCode || ev.keyCode;
- if (c == 27)
- return "Escape";
- return String.fromCharCode(c);
- }
-
- function displayHelp(display, ev) {
- if (display === true) {
- if (hasClass(help, "hidden")) {
- ev.preventDefault();
- removeClass(help, "hidden");
- addClass(document.body, "blur");
- }
- } else if (!hasClass(help, "hidden")) {
- ev.preventDefault();
- addClass(help, "hidden");
- removeClass(document.body, "blur");
- }
- }
-
- function handleEscape(ev, help) {
- hideModal();
- var search = document.getElementById("search");
- if (!hasClass(help, "hidden")) {
- displayHelp(false, ev);
- } else if (!hasClass(search, "hidden")) {
- ev.preventDefault();
- addClass(search, "hidden");
- removeClass(document.getElementById("main"), "hidden");
- }
- defocusSearchBar();
- }
-
- function handleShortcut(ev) {
- // Don't interfere with browser shortcuts
- if (ev.ctrlKey || ev.altKey || ev.metaKey) {
- return;
- }
-
- var help = document.getElementById("help");
- if (document.activeElement.tagName === "INPUT") {
- switch (getVirtualKey(ev)) {
- case "Escape":
- handleEscape(ev, help);
- break;
- }
- } else {
- switch (getVirtualKey(ev)) {
- case "Escape":
- handleEscape(ev, help);
- break;
-
- case "s":
- case "S":
- displayHelp(false, ev);
- hideModal();
- ev.preventDefault();
- focusSearchBar();
- break;
-
- case "+":
- case "-":
- ev.preventDefault();
- toggleAllDocs();
- break;
-
- case "?":
- if (ev.shiftKey) {
- hideModal();
- displayHelp(true, ev);
- }
- break;
- }
- }
- }
-
- document.onkeypress = handleShortcut;
- document.onkeydown = handleShortcut;
- document.onclick = function(ev) {
- if (hasClass(ev.target, 'collapse-toggle')) {
- collapseDocs(ev.target, "toggle");
- } else if (hasClass(ev.target.parentNode, 'collapse-toggle')) {
- collapseDocs(ev.target.parentNode, "toggle");
- } else if (ev.target.tagName === 'SPAN' && hasClass(ev.target.parentNode, 'line-numbers')) {
- var prev_id = 0;
-
- var set_fragment = function (name) {
- if (browserSupportsHistoryApi()) {
- history.replaceState(null, null, '#' + name);
- window.hashchange();
- } else {
- location.replace('#' + name);
- }
- };
-
- var cur_id = parseInt(ev.target.id, 10);
-
- if (ev.shiftKey && prev_id) {
- if (prev_id > cur_id) {
- var tmp = prev_id;
- prev_id = cur_id;
- cur_id = tmp;
- }
-
- set_fragment(prev_id + '-' + cur_id);
- } else {
- prev_id = cur_id;
-
- set_fragment(cur_id);
- }
- } else if (!hasClass(document.getElementById("help"), "hidden")) {
- addClass(document.getElementById("help"), "hidden");
- removeClass(document.body, "blur");
- }
- };
-
- var x = document.getElementsByClassName('version-selector');
- if (x.length > 0) {
- x[0].onchange = function() {
- var i, match,
- url = document.location.href,
- stripped = '',
- len = rootPath.match(/\.\.\//g).length + 1;
-
- for (i = 0; i < len; ++i) {
- match = url.match(/\/[^\/]*$/);
- if (i < len - 1) {
- stripped = match[0] + stripped;
- }
- url = url.substring(0, url.length - match[0].length);
- }
-
- url += '/' + document.getElementsByClassName('version-selector')[0].value + stripped;
-
- document.location.href = url;
- };
- }
-
- /**
- * A function to compute the Levenshtein distance between two strings
- * Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported
- * Full License can be found at http://creativecommons.org/licenses/by-sa/3.0/legalcode
- * This code is an unmodified version of the code written by Marco de Wit
- * and was found at http://stackoverflow.com/a/18514751/745719
- */
- var levenshtein_row2 = [];
- function levenshtein(s1, s2) {
- if (s1 === s2) {
- return 0;
- }
- var s1_len = s1.length, s2_len = s2.length;
- if (s1_len && s2_len) {
- var i1 = 0, i2 = 0, a, b, c, c2, row = levenshtein_row2;
- while (i1 < s1_len) {
- row[i1] = ++i1;
- }
- while (i2 < s2_len) {
- c2 = s2.charCodeAt(i2);
- a = i2;
- ++i2;
- b = i2;
- for (i1 = 0; i1 < s1_len; ++i1) {
- c = a + (s1.charCodeAt(i1) !== c2 ? 1 : 0);
- a = row[i1];
- b = b < a ? (b < c ? b + 1 : c) : (a < c ? a + 1 : c);
- row[i1] = b;
- }
- }
- return b;
- }
- return s1_len + s2_len;
- }
-
- function initSearch(rawSearchIndex) {
- var currentResults, index, searchIndex;
- var MAX_LEV_DISTANCE = 3;
- var MAX_RESULTS = 200;
- var params = getQueryStringParams();
-
- // Populate search bar with query string search term when provided,
- // but only if the input bar is empty. This avoid the obnoxious issue
- // where you start trying to do a search, and the index loads, and
- // suddenly your search is gone!
- if (document.getElementsByClassName("search-input")[0].value === "") {
- document.getElementsByClassName("search-input")[0].value = params.search || '';
- }
-
- /**
- * Executes the query and builds an index of results
- * @param {[Object]} query [The user query]
- * @param {[type]} searchWords [The list of search words to query
- * against]
- * @return {[type]} [A search index of results]
- */
- function execQuery(query, searchWords) {
- function itemTypeFromName(typename) {
- for (var i = 0; i < itemTypes.length; ++i) {
- if (itemTypes[i] === typename) {
- return i;
- }
- }
- return -1;
- }
-
- var valLower = query.query.toLowerCase(),
- val = valLower,
- typeFilter = itemTypeFromName(query.type),
- results = {}, results_in_args = {}, results_returned = {},
- split = valLower.split("::");
-
- for (var z = 0; z < split.length; ++z) {
- if (split[z] === "") {
- split.splice(z, 1);
- z -= 1;
- }
- }
-
- function transformResults(results, isType) {
- var out = [];
- for (i = 0; i < results.length; ++i) {
- if (results[i].id > -1) {
- var obj = searchIndex[results[i].id];
- obj.lev = results[i].lev;
- if (isType !== true || obj.type) {
- out.push(obj);
- }
- }
- if (out.length >= MAX_RESULTS) {
- break;
- }
- }
- return out;
- }
-
- function sortResults(results, isType) {
- var ar = [];
- for (var entry in results) {
- if (results.hasOwnProperty(entry)) {
- ar.push(results[entry]);
- }
- }
- results = ar;
- var nresults = results.length;
- for (var i = 0; i < nresults; ++i) {
- results[i].word = searchWords[results[i].id];
- results[i].item = searchIndex[results[i].id] || {};
- }
- // if there are no results then return to default and fail
- if (results.length === 0) {
- return [];
- }
-
- results.sort(function(aaa, bbb) {
- var a, b;
-
- // Sort by non levenshtein results and then levenshtein results by the distance
- // (less changes required to match means higher rankings)
- a = (aaa.lev);
- b = (bbb.lev);
- if (a !== b) { return a - b; }
-
- // sort by crate (non-current crate goes later)
- a = (aaa.item.crate !== window.currentCrate);
- b = (bbb.item.crate !== window.currentCrate);
- if (a !== b) { return a - b; }
-
- // sort by exact match (mismatch goes later)
- a = (aaa.word !== valLower);
- b = (bbb.word !== valLower);
- if (a !== b) { return a - b; }
-
- // sort by item name length (longer goes later)
- a = aaa.word.length;
- b = bbb.word.length;
- if (a !== b) { return a - b; }
-
- // sort by item name (lexicographically larger goes later)
- a = aaa.word;
- b = bbb.word;
- if (a !== b) { return (a > b ? +1 : -1); }
-
- // sort by index of keyword in item name (no literal occurrence goes later)
- a = (aaa.index < 0);
- b = (bbb.index < 0);
- if (a !== b) { return a - b; }
- // (later literal occurrence, if any, goes later)
- a = aaa.index;
- b = bbb.index;
- if (a !== b) { return a - b; }
-
- // special precedence for primitive pages
- if ((aaa.item.ty === TY_PRIMITIVE) && (bbb.item.ty !== TY_PRIMITIVE)) {
- return -1;
- }
- if ((bbb.item.ty === TY_PRIMITIVE) && (aaa.item.ty !== TY_PRIMITIVE)) {
- return 1;
- }
-
- // sort by description (no description goes later)
- a = (aaa.item.desc === '');
- b = (bbb.item.desc === '');
- if (a !== b) { return a - b; }
-
- // sort by type (later occurrence in `itemTypes` goes later)
- a = aaa.item.ty;
- b = bbb.item.ty;
- if (a !== b) { return a - b; }
-
- // sort by path (lexicographically larger goes later)
- a = aaa.item.path;
- b = bbb.item.path;
- if (a !== b) { return (a > b ? +1 : -1); }
-
- // que sera, sera
- return 0;
- });
-
- for (var i = 0; i < results.length; ++i) {
- var result = results[i];
-
- // this validation does not make sense when searching by types
- if (result.dontValidate) {
- continue;
- }
- var name = result.item.name.toLowerCase(),
- path = result.item.path.toLowerCase(),
- parent = result.item.parent;
-
- if (isType !== true &&
- validateResult(name, path, split, parent) === false)
- {
- result.id = -1;
- }
- }
- return transformResults(results);
- }
-
- function extractGenerics(val) {
- val = val.toLowerCase();
- if (val.indexOf('<') !== -1) {
- var values = val.substring(val.indexOf('<') + 1, val.lastIndexOf('>'));
- return {
- name: val.substring(0, val.indexOf('<')),
- generics: values.split(/\s*,\s*/),
- };
- }
- return {
- name: val,
- generics: [],
- };
- }
-
- function checkGenerics(obj, val) {
- // The names match, but we need to be sure that all generics kinda
- // match as well.
- var lev_distance = MAX_LEV_DISTANCE + 1;
- if (val.generics.length > 0) {
- if (obj.generics && obj.generics.length >= val.generics.length) {
- var elems = obj.generics.slice(0);
- var total = 0;
- var done = 0;
- // We need to find the type that matches the most to remove it in order
- // to move forward.
- for (var y = 0; y < val.generics.length; ++y) {
- var lev = { pos: -1, lev: MAX_LEV_DISTANCE + 1};
- for (var x = 0; x < elems.length; ++x) {
- var tmp_lev = levenshtein(elems[x], val.generics[y]);
- if (tmp_lev < lev.lev) {
- lev.lev = tmp_lev;
- lev.pos = x;
- }
- }
- if (lev.pos !== -1) {
- elems.splice(lev.pos, 1);
- lev_distance = Math.min(lev.lev, lev_distance);
- total += lev.lev;
- done += 1;
- } else {
- return MAX_LEV_DISTANCE + 1;
- }
- }
- return lev_distance;//Math.ceil(total / done);
- }
- }
- return MAX_LEV_DISTANCE + 1;
- }
-
- // Check for type name and type generics (if any).
- function checkType(obj, val, literalSearch) {
- var lev_distance = MAX_LEV_DISTANCE + 1;
- if (obj.name === val.name) {
- if (literalSearch === true) {
- if (val.generics && val.generics.length !== 0) {
- if (obj.generics && obj.length >= val.generics.length) {
- var elems = obj.generics.slice(0);
- var allFound = true;
- var x;
-
- for (var y = 0; allFound === true && y < val.generics.length; ++y) {
- allFound = false;
- for (x = 0; allFound === false && x < elems.length; ++x) {
- allFound = elems[x] === val.generics[y];
- }
- if (allFound === true) {
- elems.splice(x - 1, 1);
- }
- }
- if (allFound === true) {
- return true;
- }
- } else {
- return false;
- }
- }
- return true;
- }
- // If the type has generics but don't match, then it won't return at this point.
- // Otherwise, `checkGenerics` will return 0 and it'll return.
- if (obj.generics && obj.generics.length !== 0) {
- var tmp_lev = checkGenerics(obj, val);
- if (tmp_lev <= MAX_LEV_DISTANCE) {
- return tmp_lev;
- }
- } else {
- return 0;
- }
- }
- // Names didn't match so let's check if one of the generic types could.
- if (literalSearch === true) {
- if (obj.generics && obj.generics.length > 0) {
- for (var x = 0; x < obj.generics.length; ++x) {
- if (obj.generics[x] === val.name) {
- return true;
- }
- }
- }
- return false;
- }
- var lev_distance = Math.min(levenshtein(obj.name, val.name), lev_distance);
- if (lev_distance <= MAX_LEV_DISTANCE) {
- lev_distance = Math.min(checkGenerics(obj, val), lev_distance);
- } else if (obj.generics && obj.generics.length > 0) {
- // We can check if the type we're looking for is inside the generics!
- for (var x = 0; x < obj.generics.length; ++x) {
- lev_distance = Math.min(levenshtein(obj.generics[x], val.name),
- lev_distance);
- }
- }
- // Now whatever happens, the returned distance is "less good" so we should mark it
- // as such, and so we add 1 to the distance to make it "less good".
- return lev_distance + 1;
- }
-
- function findArg(obj, val, literalSearch) {
- var lev_distance = MAX_LEV_DISTANCE + 1;
-
- if (obj && obj.type && obj.type.inputs.length > 0) {
- for (var i = 0; i < obj.type.inputs.length; i++) {
- var tmp = checkType(obj.type.inputs[i], val, literalSearch);
- if (literalSearch === true && tmp === true) {
- return true;
- }
- lev_distance = Math.min(tmp, lev_distance);
- if (lev_distance === 0) {
- return 0;
- }
- }
- }
- return literalSearch === true ? false : lev_distance;
- }
-
- function checkReturned(obj, val, literalSearch) {
- var lev_distance = MAX_LEV_DISTANCE + 1;
-
- if (obj && obj.type && obj.type.output) {
- var tmp = checkType(obj.type.output, val, literalSearch);
- if (literalSearch === true && tmp === true) {
- return true;
- }
- lev_distance = Math.min(tmp, lev_distance);
- if (lev_distance === 0) {
- return 0;
- }
- }
- return literalSearch === true ? false : lev_distance;
- }
-
- function checkPath(startsWith, lastElem, ty) {
- if (startsWith.length === 0) {
- return 0;
- }
- var ret_lev = MAX_LEV_DISTANCE + 1;
- var path = ty.path.split("::");
-
- if (ty.parent && ty.parent.name) {
- path.push(ty.parent.name.toLowerCase());
- }
-
- if (startsWith.length > path.length) {
- return MAX_LEV_DISTANCE + 1;
- }
- for (var i = 0; i < path.length; ++i) {
- if (i + startsWith.length > path.length) {
- break;
- }
- var lev_total = 0;
- var aborted = false;
- for (var x = 0; x < startsWith.length; ++x) {
- var lev = levenshtein(path[i + x], startsWith[x]);
- if (lev > MAX_LEV_DISTANCE) {
- aborted = true;
- break;
- }
- lev_total += lev;
- }
- if (aborted === false) {
- ret_lev = Math.min(ret_lev, Math.round(lev_total / startsWith.length));
- }
- }
- return ret_lev;
- }
-
- function typePassesFilter(filter, type) {
- // No filter
- if (filter < 0) return true;
-
- // Exact match
- if (filter === type) return true;
-
- // Match related items
- var name = itemTypes[type];
- switch (itemTypes[filter]) {
- case "constant":
- return (name == "associatedconstant");
- case "fn":
- return (name == "method" || name == "tymethod");
- case "type":
- return (name == "primitive");
- }
-
- // No match
- return false;
- }
-
- function generateId(ty) {
- if (ty.parent && ty.parent.name) {
- return itemTypes[ty.ty] + ty.path + ty.parent.name + ty.name;
- }
- return itemTypes[ty.ty] + ty.path + ty.name;
- }
-
- // quoted values mean literal search
- var nSearchWords = searchWords.length;
- if ((val.charAt(0) === "\"" || val.charAt(0) === "'") &&
- val.charAt(val.length - 1) === val.charAt(0))
- {
- val = extractGenerics(val.substr(1, val.length - 2));
- for (var i = 0; i < nSearchWords; ++i) {
- var in_args = findArg(searchIndex[i], val, true);
- var returned = checkReturned(searchIndex[i], val, true);
- var ty = searchIndex[i];
- var fullId = generateId(ty);
-
- if (searchWords[i] === val.name) {
- // filter type: ... queries
- if (typePassesFilter(typeFilter, searchIndex[i].ty) &&
- results[fullId] === undefined)
- {
- results[fullId] = {id: i, index: -1};
- }
- } else if ((in_args === true || returned === true) &&
- typePassesFilter(typeFilter, searchIndex[i].ty)) {
- if (in_args === true || returned === true) {
- if (in_args === true) {
- results_in_args[fullId] = {
- id: i,
- index: -1,
- dontValidate: true,
- };
- }
- if (returned === true) {
- results_returned[fullId] = {
- id: i,
- index: -1,
- dontValidate: true,
- };
- }
- } else {
- results[fullId] = {
- id: i,
- index: -1,
- dontValidate: true,
- };
- }
- }
- }
- query.inputs = [val];
- query.output = val;
- query.search = val;
- // searching by type
- } else if (val.search("->") > -1) {
- var trimmer = function (s) { return s.trim(); };
- var parts = val.split("->").map(trimmer);
- var input = parts[0];
- // sort inputs so that order does not matter
- var inputs = input.split(",").map(trimmer).sort();
- for (var i = 0; i < inputs.length; ++i) {
- inputs[i] = extractGenerics(inputs[i]);
- }
- var output = extractGenerics(parts[1]);
-
- for (var i = 0; i < nSearchWords; ++i) {
- var type = searchIndex[i].type;
- var ty = searchIndex[i];
- if (!type) {
- continue;
- }
- var fullId = generateId(ty);
-
- // allow searching for void (no output) functions as well
- var typeOutput = type.output ? type.output.name : "";
- var returned = checkReturned(ty, output, true);
- if (output.name === "*" || returned === true) {
- var in_args = false;
- var module = false;
-
- if (input === "*") {
- module = true;
- } else {
- var allFound = true;
- for (var it = 0; allFound === true && it < inputs.length; it++) {
- allFound = checkType(type, inputs[it], true);
- }
- in_args = allFound;
- }
- if (in_args === true) {
- results_in_args[fullId] = {
- id: i,
- index: -1,
- dontValidate: true,
- };
- }
- if (returned === true) {
- results_returned[fullId] = {
- id: i,
- index: -1,
- dontValidate: true,
- };
- }
- if (module === true) {
- results[fullId] = {
- id: i,
- index: -1,
- dontValidate: true,
- };
- }
- }
- }
- query.inputs = inputs.map(function(input) {
- return input.name;
- });
- query.output = output.name;
- } else {
- query.inputs = [val];
- query.output = val;
- query.search = val;
- // gather matching search results up to a certain maximum
- val = val.replace(/\_/g, "");
-
- var valGenerics = extractGenerics(val);
-
- var paths = valLower.split("::");
- var j;
- for (j = 0; j < paths.length; ++j) {
- if (paths[j] === "") {
- paths.splice(j, 1);
- j -= 1;
- }
- }
- val = paths[paths.length - 1];
- var startsWith = paths.slice(0, paths.length > 1 ? paths.length - 1 : 1);
-
- for (j = 0; j < nSearchWords; ++j) {
- var lev_distance;
- var ty = searchIndex[j];
- if (!ty) {
- continue;
- }
- var lev_add = 0;
- if (paths.length > 1) {
- var lev = checkPath(startsWith, paths[paths.length - 1], ty);
- if (lev > MAX_LEV_DISTANCE) {
- continue;
- } else if (lev > 0) {
- lev_add = 1;
- }
- }
-
- var returned = MAX_LEV_DISTANCE + 1;
- var in_args = MAX_LEV_DISTANCE + 1;
- var index = -1;
- // we want lev results to go lower than others
- var lev = MAX_LEV_DISTANCE + 1;
- var fullId = generateId(ty);
-
- if (searchWords[j].indexOf(split[i]) > -1 ||
- searchWords[j].indexOf(val) > -1 ||
- searchWords[j].replace(/_/g, "").indexOf(val) > -1)
- {
- // filter type: ... queries
- if (typePassesFilter(typeFilter, ty.ty) && results[fullId] === undefined) {
- index = searchWords[j].replace(/_/g, "").indexOf(val);
- }
- }
- if ((lev = levenshtein(searchWords[j], val)) <= MAX_LEV_DISTANCE) {
- if (typePassesFilter(typeFilter, ty.ty) === false) {
- lev = MAX_LEV_DISTANCE + 1;
- } else {
- lev += 1;
- }
- }
- if ((in_args = findArg(ty, valGenerics)) <= MAX_LEV_DISTANCE) {
- if (typePassesFilter(typeFilter, ty.ty) === false) {
- in_args = MAX_LEV_DISTANCE + 1;
- }
- }
- if ((returned = checkReturned(ty, valGenerics)) <= MAX_LEV_DISTANCE) {
- if (typePassesFilter(typeFilter, ty.ty) === false) {
- returned = MAX_LEV_DISTANCE + 1;
- }
- }
-
- lev += lev_add;
- if (lev > 0 && val.length > 3 && searchWords[j].startsWith(val)) {
- if (val.length < 6) {
- lev -= 1;
- } else {
- lev = 0;
- }
- }
- if (in_args <= MAX_LEV_DISTANCE) {
- if (results_in_args[fullId] === undefined) {
- results_in_args[fullId] = {
- id: j,
- index: index,
- lev: in_args,
- };
- }
- results_in_args[fullId].lev =
- Math.min(results_in_args[fullId].lev, in_args);
- }
- if (returned <= MAX_LEV_DISTANCE) {
- if (results_returned[fullId] === undefined) {
- results_returned[fullId] = {
- id: j,
- index: index,
- lev: returned,
- };
- }
- results_returned[fullId].lev =
- Math.min(results_returned[fullId].lev, returned);
- }
- if (index !== -1 || lev <= MAX_LEV_DISTANCE) {
- if (index !== -1) {
- lev = 0;
- }
- if (results[fullId] === undefined) {
- results[fullId] = {
- id: j,
- index: index,
- lev: lev,
- };
- }
- results[fullId].lev = Math.min(results[fullId].lev, lev);
- }
- }
- }
-
- return {
- 'in_args': sortResults(results_in_args, true),
- 'returned': sortResults(results_returned, true),
- 'others': sortResults(results),
- };
- }
-
- /**
- * Validate performs the following boolean logic. For example:
- * "File::open" will give IF A PARENT EXISTS => ("file" && "open")
- * exists in (name || path || parent) OR => ("file" && "open") exists in
- * (name || path )
- *
- * This could be written functionally, but I wanted to minimise
- * functions on stack.
- *
- * @param {[string]} name [The name of the result]
- * @param {[string]} path [The path of the result]
- * @param {[string]} keys [The keys to be used (["file", "open"])]
- * @param {[object]} parent [The parent of the result]
- * @return {[boolean]} [Whether the result is valid or not]
- */
- function validateResult(name, path, keys, parent) {
- for (var i = 0; i < keys.length; ++i) {
- // each check is for validation so we negate the conditions and invalidate
- if (!(
- // check for an exact name match
- name.indexOf(keys[i]) > -1 ||
- // then an exact path match
- path.indexOf(keys[i]) > -1 ||
- // next if there is a parent, check for exact parent match
- (parent !== undefined &&
- parent.name.toLowerCase().indexOf(keys[i]) > -1) ||
- // lastly check to see if the name was a levenshtein match
- levenshtein(name, keys[i]) <= MAX_LEV_DISTANCE)) {
- return false;
- }
- }
- return true;
- }
-
- function getQuery(raw) {
- var matches, type, query;
- query = raw;
-
- matches = query.match(/^(fn|mod|struct|enum|trait|type|const|macro)\s*:\s*/i);
- if (matches) {
- type = matches[1].replace(/^const$/, 'constant');
- query = query.substring(matches[0].length);
- }
-
- return {
- raw: raw,
- query: query,
- type: type,
- id: query + type
- };
- }
-
- function initSearchNav() {
- var hoverTimeout;
-
- var click_func = function(e) {
- var el = e.target;
- // to retrieve the real "owner" of the event.
- while (el.tagName !== 'TR') {
- el = el.parentNode;
- }
- var dst = e.target.getElementsByTagName('a');
- if (dst.length < 1) {
- return;
- }
- dst = dst[0];
- if (window.location.pathname === dst.pathname) {
- addClass(document.getElementById('search'), 'hidden');
- removeClass(document.getElementById('main'), 'hidden');
- document.location.href = dst.href;
- }
- };
- var mouseover_func = function(e) {
- var el = e.target;
- // to retrieve the real "owner" of the event.
- while (el.tagName !== 'TR') {
- el = el.parentNode;
- }
- clearTimeout(hoverTimeout);
- hoverTimeout = setTimeout(function() {
- onEach(document.getElementsByClassName('search-results'), function(e) {
- onEach(e.getElementsByClassName('result'), function(i_e) {
- removeClass(i_e, 'highlighted');
- });
- });
- addClass(el, 'highlighted');
- }, 20);
- };
- onEach(document.getElementsByClassName('search-results'), function(e) {
- onEach(e.getElementsByClassName('result'), function(i_e) {
- i_e.onclick = click_func;
- i_e.onmouseover = mouseover_func;
- });
- });
-
- var search_input = document.getElementsByClassName('search-input')[0];
- search_input.onkeydown = function(e) {
- // "actives" references the currently highlighted item in each search tab.
- // Each array in "actives" represents a tab.
- var actives = [[], [], []];
- // "current" is used to know which tab we're looking into.
- var current = 0;
- onEach(document.getElementsByClassName('search-results'), function(e) {
- onEach(e.getElementsByClassName('highlighted'), function(e) {
- actives[current].push(e);
- });
- current += 1;
- });
-
- if (e.which === 38) { // up
- if (!actives[currentTab].length ||
- !actives[currentTab][0].previousElementSibling) {
- return;
- }
-
- addClass(actives[currentTab][0].previousElementSibling, 'highlighted');
- removeClass(actives[currentTab][0], 'highlighted');
- } else if (e.which === 40) { // down
- if (!actives[currentTab].length) {
- var results = document.getElementsByClassName('search-results');
- if (results.length > 0) {
- var res = results[currentTab].getElementsByClassName('result');
- if (res.length > 0) {
- addClass(res[0], 'highlighted');
- }
- }
- } else if (actives[currentTab][0].nextElementSibling) {
- addClass(actives[currentTab][0].nextElementSibling, 'highlighted');
- removeClass(actives[currentTab][0], 'highlighted');
- }
- } else if (e.which === 13) { // return
- if (actives[currentTab].length) {
- document.location.href =
- actives[currentTab][0].getElementsByTagName('a')[0].href;
- }
- } else if (e.which === 9) { // tab
- if (e.shiftKey) {
- printTab(currentTab > 0 ? currentTab - 1 : 2);
- } else {
- printTab(currentTab > 1 ? 0 : currentTab + 1);
- }
- e.preventDefault();
- } else if (e.which === 16) { // shift
- // Does nothing, it's just to avoid losing "focus" on the highlighted element.
- } else if (e.which === 27) { // escape
- removeClass(actives[currentTab][0], 'highlighted');
- document.getElementsByClassName('search-input')[0].value = '';
- defocusSearchBar();
- } else if (actives[currentTab].length > 0) {
- removeClass(actives[currentTab][0], 'highlighted');
- }
- };
- }
-
- function escape(content) {
- var h1 = document.createElement('h1');
- h1.textContent = content;
- return h1.innerHTML;
- }
-
- function pathSplitter(path) {
- return '<span>' + path.replace(/::/g, '::</span><span>');
- }
-
- function addTab(array, query, display) {
- var extraStyle = '';
- if (display === false) {
- extraStyle = ' style="display: none;"';
- }
-
- var output = '';
- if (array.length > 0) {
- output = '<table class="search-results"' + extraStyle + '>';
- var shown = [];
-
- array.forEach(function(item) {
- var name, type, href, displayPath;
-
- if (shown.indexOf(item) !== -1) {
- return;
- }
-
- shown.push(item);
- name = item.name;
- type = itemTypes[item.ty];
-
- if (type === 'mod') {
- displayPath = item.path + '::';
- href = rootPath + item.path.replace(/::/g, '/') + '/' +
- name + '/index.html';
- } else if (type === "primitive") {
- displayPath = "";
- href = rootPath + item.path.replace(/::/g, '/') +
- '/' + type + '.' + name + '.html';
- } else if (type === "externcrate") {
- displayPath = "";
- href = rootPath + name + '/index.html';
- } else if (item.parent !== undefined) {
- var myparent = item.parent;
- var anchor = '#' + type + '.' + name;
- var parentType = itemTypes[myparent.ty];
- if (parentType === "primitive") {
- displayPath = myparent.name + '::';
- } else {
- displayPath = item.path + '::' + myparent.name + '::';
- }
- href = rootPath + item.path.replace(/::/g, '/') +
- '/' + parentType +
- '.' + myparent.name +
- '.html' + anchor;
- } else {
- displayPath = item.path + '::';
- href = rootPath + item.path.replace(/::/g, '/') +
- '/' + type + '.' + name + '.html';
- }
-
- output += '<tr class="' + type + ' result"><td>' +
- '<a href="' + href + '">' +
- pathSplitter(displayPath) + '<span class="' + type + '">' +
- name + '</span></a></td><td>' +
- '<a href="' + href + '">' +
- '<span class="desc">' + escape(item.desc) +
- '&nbsp;</span></a></td></tr>';
- });
- output += '</table>';
- } else {
- output = '<div class="search-failed"' + extraStyle + '>No results :(<br/>' +
- 'Try on <a href="https://duckduckgo.com/?q=' +
- encodeURIComponent('rust ' + query.query) +
- '">DuckDuckGo</a>?</div>';
- }
- return output;
- }
-
- function makeTabHeader(tabNb, text, nbElems) {
- if (currentTab === tabNb) {
- return '<div class="selected">' + text +
- ' <div class="count">(' + nbElems + ')</div></div>';
- }
- return '<div>' + text + ' <div class="count">(' + nbElems + ')</div></div>';
- }
-
- function showResults(results) {
- var output, query = getQuery(document.getElementsByClassName('search-input')[0].value);
-
- currentResults = query.id;
- output = '<h1>Results for ' + escape(query.query) +
- (query.type ? ' (type: ' + escape(query.type) + ')' : '') + '</h1>' +
- '<div id="titles">' +
- makeTabHeader(0, "In Names", results['others'].length) +
- makeTabHeader(1, "In Parameters", results['in_args'].length) +
- makeTabHeader(2, "In Return Types", results['returned'].length) +
- '</div><div id="results">';
-
- output += addTab(results['others'], query);
- output += addTab(results['in_args'], query, false);
- output += addTab(results['returned'], query, false);
- output += '</div>';
-
- addClass(document.getElementById('main'), 'hidden');
- var search = document.getElementById('search');
- removeClass(search, 'hidden');
- search.innerHTML = output;
- var tds = search.getElementsByTagName('td');
- var td_width = 0;
- if (tds.length > 0) {
- td_width = tds[0].offsetWidth;
- }
- var width = search.offsetWidth - 40 - td_width;
- onEach(search.getElementsByClassName('desc'), function(e) {
- e.style.width = width + 'px';
- });
- initSearchNav();
- var elems = document.getElementById('titles').childNodes;
- elems[0].onclick = function() { printTab(0); };
- elems[1].onclick = function() { printTab(1); };
- elems[2].onclick = function() { printTab(2); };
- printTab(currentTab);
- }
-
- function search(e) {
- var query,
- obj, i, len,
- results = {"in_args": [], "returned": [], "others": []},
- resultIndex;
- var params = getQueryStringParams();
-
- query = getQuery(document.getElementsByClassName('search-input')[0].value);
- if (e) {
- e.preventDefault();
- }
-
- if (!query.query || query.id === currentResults) {
- return;
- }
-
- // Update document title to maintain a meaningful browser history
- document.title = "Results for " + query.query + " - Rust";
-
- // Because searching is incremental by character, only the most
- // recent search query is added to the browser history.
- if (browserSupportsHistoryApi()) {
- if (!history.state && !params.search) {
- history.pushState(query, "", "?search=" + encodeURIComponent(query.raw));
- } else {
- history.replaceState(query, "", "?search=" + encodeURIComponent(query.raw));
- }
- }
-
- results = execQuery(query, index);
- showResults(results);
- }
-
- function buildIndex(rawSearchIndex) {
- searchIndex = [];
- var searchWords = [];
- for (var crate in rawSearchIndex) {
- if (!rawSearchIndex.hasOwnProperty(crate)) { continue; }
-
- searchWords.push(crate);
- searchIndex.push({
- crate: crate,
- ty: 1, // == ExternCrate
- name: crate,
- path: "",
- desc: rawSearchIndex[crate].doc,
- type: null,
- });
-
- // an array of [(Number) item type,
- // (String) name,
- // (String) full path or empty string for previous path,
- // (String) description,
- // (Number | null) the parent path index to `paths`]
- // (Object | null) the type of the function (if any)
- var items = rawSearchIndex[crate].items;
- // an array of [(Number) item type,
- // (String) name]
- var paths = rawSearchIndex[crate].paths;
-
- // convert `paths` into an object form
- var len = paths.length;
- for (var i = 0; i < len; ++i) {
- paths[i] = {ty: paths[i][0], name: paths[i][1]};
- }
-
- // convert `items` into an object form, and construct word indices.
- //
- // before any analysis is performed lets gather the search terms to
- // search against apart from the rest of the data. This is a quick
- // operation that is cached for the life of the page state so that
- // all other search operations have access to this cached data for
- // faster analysis operations
- var len = items.length;
- var lastPath = "";
- for (var i = 0; i < len; ++i) {
- var rawRow = items[i];
- var row = {crate: crate, ty: rawRow[0], name: rawRow[1],
- path: rawRow[2] || lastPath, desc: rawRow[3],
- parent: paths[rawRow[4]], type: rawRow[5]};
- searchIndex.push(row);
- if (typeof row.name === "string") {
- var word = row.name.toLowerCase();
- searchWords.push(word);
- } else {
- searchWords.push("");
- }
- lastPath = row.path;
- }
- }
- return searchWords;
- }
-
- function startSearch() {
- var searchTimeout;
- var callback = function() {
- var search_input = document.getElementsByClassName('search-input');
- if (search_input.length < 1) { return; }
- search_input = search_input[0];
- clearTimeout(searchTimeout);
- if (search_input.value.length === 0) {
- if (browserSupportsHistoryApi()) {
- history.replaceState("", "std - Rust", "?search=");
- }
- var main = document.getElementById('main');
- if (hasClass(main, 'content')) {
- removeClass(main, 'hidden');
- }
- var search_c = document.getElementById('search');
- if (hasClass(search_c, 'content')) {
- addClass(search_c, 'hidden');
- }
- } else {
- searchTimeout = setTimeout(search, 500);
- }
- };
- var search_input = document.getElementsByClassName("search-input")[0];
- search_input.onkeyup = callback;
- search_input.oninput = callback;
- document.getElementsByClassName("search-form")[0].onsubmit = function(e) {
- e.preventDefault();
- clearTimeout(searchTimeout);
- search();
- };
- search_input.onchange = function(e) {
- // Do NOT e.preventDefault() here. It will prevent pasting.
- clearTimeout(searchTimeout);
- // zero-timeout necessary here because at the time of event handler execution the
- // pasted content is not in the input field yet. Shouldn’t make any difference for
- // change, though.
- setTimeout(search, 0);
- };
- search_input.onpaste = search_input.onchange;
-
- // Push and pop states are used to add search results to the browser
- // history.
- if (browserSupportsHistoryApi()) {
- // Store the previous <title> so we can revert back to it later.
- var previousTitle = document.title;
-
- window.onpopstate = function(e) {
- var params = getQueryStringParams();
- // When browsing back from search results the main page
- // visibility must be reset.
- if (!params.search) {
- var main = document.getElementById('main');
- if (hasClass(main, 'content')) {
- removeClass(main, 'hidden');
- }
- var search_c = document.getElementById('search');
- if (hasClass(search_c, 'content')) {
- addClass(search_c, 'hidden');
- }
- }
- // Revert to the previous title manually since the History
- // API ignores the title parameter.
- document.title = previousTitle;
- // When browsing forward to search results the previous
- // search will be repeated, so the currentResults are
- // cleared to ensure the search is successful.
- currentResults = null;
- // Synchronize search bar with query string state and
- // perform the search. This will empty the bar if there's
- // nothing there, which lets you really go back to a
- // previous state with nothing in the bar.
- if (params.search) {
- document.getElementsByClassName('search-input')[0].value = params.search;
- } else {
- document.getElementsByClassName('search-input')[0].value = '';
- }
- // Some browsers fire 'onpopstate' for every page load
- // (Chrome), while others fire the event only when actually
- // popping a state (Firefox), which is why search() is
- // called both here and at the end of the startSearch()
- // function.
- search();
- };
- }
- search();
- }
-
- index = buildIndex(rawSearchIndex);
- startSearch();
-
- // Draw a convenient sidebar of known crates if we have a listing
- if (rootPath === '../') {
- var sidebar = document.getElementsByClassName('sidebar-elems')[0];
- if (sidebar) {
- var div = document.createElement('div');
- div.className = 'block crate';
- div.innerHTML = '<h3>Crates</h3>';
- var ul = document.createElement('ul');
- div.appendChild(ul);
-
- var crates = [];
- for (var crate in rawSearchIndex) {
- if (!rawSearchIndex.hasOwnProperty(crate)) {
- continue;
- }
- crates.push(crate);
- }
- crates.sort();
- for (var i = 0; i < crates.length; ++i) {
- var klass = 'crate';
- if (crates[i] === window.currentCrate) {
- klass += ' current';
- }
- var link = document.createElement('a');
- link.href = '../' + crates[i] + '/index.html';
- link.title = rawSearchIndex[crates[i]].doc;
- link.className = klass;
- link.textContent = crates[i];
-
- var li = document.createElement('li');
- li.appendChild(link);
- ul.appendChild(li);
- }
- sidebar.appendChild(div);
- }
- }
- }
-
- window.initSearch = initSearch;
-
- // delayed sidebar rendering.
- function initSidebarItems(items) {
- var sidebar = document.getElementsByClassName('sidebar-elems')[0];
- var current = window.sidebarCurrent;
-
- function block(shortty, longty) {
- var filtered = items[shortty];
- if (!filtered) { return; }
-
- var div = document.createElement('div');
- div.className = 'block ' + shortty;
- var h3 = document.createElement('h3');
- h3.textContent = longty;
- div.appendChild(h3);
- var ul = document.createElement('ul');
-
- for (var i = 0; i < filtered.length; ++i) {
- var item = filtered[i];
- var name = item[0];
- var desc = item[1]; // can be null
-
- var klass = shortty;
- if (name === current.name && shortty === current.ty) {
- klass += ' current';
- }
- var path;
- if (shortty === 'mod') {
- path = name + '/index.html';
- } else {
- path = shortty + '.' + name + '.html';
- }
- var link = document.createElement('a');
- link.href = current.relpath + path;
- link.title = desc;
- link.className = klass;
- link.textContent = name;
- var li = document.createElement('li');
- li.appendChild(link);
- ul.appendChild(li);
- }
- div.appendChild(ul);
- if (sidebar) {
- sidebar.appendChild(div);
- }
- }
-
- block("primitive", "Primitive Types");
- block("mod", "Modules");
- block("macro", "Macros");
- block("struct", "Structs");
- block("enum", "Enums");
- block("union", "Unions");
- block("constant", "Constants");
- block("static", "Statics");
- block("trait", "Traits");
- block("fn", "Functions");
- block("type", "Type Definitions");
- block("foreigntype", "Foreign Types");
- }
-
- window.initSidebarItems = initSidebarItems;
-
- window.register_implementors = function(imp) {
- var implementors = document.getElementById('implementors-list');
- var synthetic_implementors = document.getElementById('synthetic-implementors-list');
-
- var libs = Object.getOwnPropertyNames(imp);
- for (var i = 0; i < libs.length; ++i) {
- if (libs[i] === currentCrate) { continue; }
- var structs = imp[libs[i]];
-
- struct_loop:
- for (var j = 0; j < structs.length; ++j) {
- var struct = structs[j];
-
- var list = struct.synthetic ? synthetic_implementors : implementors;
-
- if (struct.synthetic) {
- for (var k = 0; k < struct.types.length; k++) {
- if (window.inlined_types.has(struct.types[k])) {
- continue struct_loop;
- }
- window.inlined_types.add(struct.types[k]);
- }
- }
-
- var code = document.createElement('code');
- code.innerHTML = struct.text;
-
- var x = code.getElementsByTagName('a');
- for (var k = 0; k < x.length; k++) {
- var href = x[k].getAttribute('href');
- if (href && href.indexOf('http') !== 0) {
- x[k].setAttribute('href', rootPath + href);
- }
- }
- var li = document.createElement('li');
- li.appendChild(code);
- list.appendChild(li);
- }
- }
- };
- if (window.pending_implementors) {
- window.register_implementors(window.pending_implementors);
- }
-
- function labelForToggleButton(sectionIsCollapsed) {
- if (sectionIsCollapsed) {
- // button will expand the section
- return "+";
- }
- // button will collapse the section
- // note that this text is also set in the HTML template in render.rs
- return "\u2212"; // "\u2212" is '−' minus sign
- }
-
- function onEveryMatchingChild(elem, className, func) {
- if (elem && className && func) {
- for (var i = 0; i < elem.childNodes.length; i++) {
- if (hasClass(elem.childNodes[i], className)) {
- func(elem.childNodes[i]);
- } else {
- onEveryMatchingChild(elem.childNodes[i], className, func);
- }
- }
- }
- }
-
- function toggleAllDocs() {
- var toggle = document.getElementById("toggle-all-docs");
- if (hasClass(toggle, "will-expand")) {
- updateLocalStorage("rustdoc-collapse", "false");
- removeClass(toggle, "will-expand");
- onEveryMatchingChild(toggle, "inner", function(e) {
- e.innerHTML = labelForToggleButton(false);
- });
- toggle.title = "collapse all docs";
- onEach(document.getElementsByClassName("collapse-toggle"), function(e) {
- collapseDocs(e, "show");
- });
- } else {
- updateLocalStorage("rustdoc-collapse", "true");
- addClass(toggle, "will-expand");
- onEveryMatchingChild(toggle, "inner", function(e) {
- e.innerHTML = labelForToggleButton(true);
- });
- toggle.title = "expand all docs";
-
- onEach(document.getElementsByClassName("collapse-toggle"), function(e) {
- collapseDocs(e, "hide");
- });
- }
- }
-
- function collapseDocs(toggle, mode) {
- if (!toggle || !toggle.parentNode) {
- return;
- }
-
- function adjustToggle(arg) {
- return function(e) {
- if (hasClass(e, 'toggle-label')) {
- if (arg) {
- e.style.display = 'inline-block';
- } else {
- e.style.display = 'none';
- }
- }
- if (hasClass(e, 'inner')) {
- e.innerHTML = labelForToggleButton(arg);
- }
- };
- };
-
- if (!hasClass(toggle.parentNode, "impl")) {
- var relatedDoc = toggle.parentNode.nextElementSibling;
- if (hasClass(relatedDoc, "stability")) {
- relatedDoc = relatedDoc.nextElementSibling;
- }
- if (hasClass(relatedDoc, "docblock")) {
- var action = mode;
- if (action === "toggle") {
- if (hasClass(relatedDoc, "hidden-by-usual-hider")) {
- action = "show";
- } else {
- action = "hide";
- }
- }
- if (action === "hide") {
- addClass(relatedDoc, "hidden-by-usual-hider");
- onEach(toggle.childNodes, adjustToggle(true));
- addClass(toggle.parentNode, 'collapsed');
- } else if (action === "show") {
- removeClass(relatedDoc, "hidden-by-usual-hider");
- removeClass(toggle.parentNode, 'collapsed');
- onEach(toggle.childNodes, adjustToggle(false));
- }
- }
- } else {
- // we are collapsing the impl block
- function implHider(addOrRemove) {
- return function(n) {
- var is_method = hasClass(n, "method");
- if (is_method || hasClass(n, "type")) {
- if (is_method === true) {
- if (addOrRemove) {
- addClass(n, "hidden-by-impl-hider");
- } else {
- removeClass(n, "hidden-by-impl-hider");
- }
- }
- var ns = n.nextElementSibling;
- while (true) {
- if (ns && (
- hasClass(ns, "docblock") ||
- hasClass(ns, "stability"))) {
- if (addOrRemove) {
- addClass(ns, "hidden-by-impl-hider");
- } else {
- removeClass(ns, "hidden-by-impl-hider");
- }
- ns = ns.nextElementSibling;
- continue;
- }
- break;
- }
- }
- }
- }
-
- var relatedDoc = toggle.parentNode;
- var docblock = relatedDoc.nextElementSibling;
-
- while (!hasClass(relatedDoc, "impl-items")) {
- relatedDoc = relatedDoc.nextElementSibling;
- }
-
- if (!relatedDoc && !hasClass(docblock, "docblock")) {
- return;
- }
-
- // Hide all functions, but not associated types/consts
-
- var action = mode;
- if (action === "toggle") {
- if (hasClass(relatedDoc, "fns-now-collapsed") ||
- hasClass(docblock, "hidden-by-impl-hider")) {
- action = "show";
- } else {
- action = "hide";
- }
- }
-
- if (action === "show") {
- removeClass(relatedDoc, "fns-now-collapsed");
- removeClass(docblock, "hidden-by-usual-hider");
- onEach(toggle.childNodes, adjustToggle(false));
- onEach(relatedDoc.childNodes, implHider(false));
- } else if (action === "hide") {
- addClass(relatedDoc, "fns-now-collapsed");
- addClass(docblock, "hidden-by-usual-hider");
- onEach(toggle.childNodes, adjustToggle(true));
- onEach(relatedDoc.childNodes, implHider(true));
- }
- }
- }
-
- function autoCollapseAllImpls() {
- // Automatically minimize all non-inherent impls
- onEach(document.getElementsByClassName('impl'), function(n) {
- // inherent impl ids are like 'impl' or impl-<number>'
- var inherent = (n.id.match(/^impl(?:-\d+)?$/) !== null);
- if (!inherent) {
- onEach(n.childNodes, function(m) {
- if (hasClass(m, "collapse-toggle")) {
- collapseDocs(m, "hide");
- }
- });
- }
- });
- }
-
- var x = document.getElementById('toggle-all-docs');
- if (x) {
- x.onclick = toggleAllDocs;
- }
-
- function insertAfter(newNode, referenceNode) {
- referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
- }
-
- function checkIfThereAreMethods(elems) {
- var areThereMethods = false;
-
- onEach(elems, function(e) {
- if (hasClass(e, "method")) {
- areThereMethods = true;
- return true;
- }
- });
- return areThereMethods;
- }
-
- var toggle = document.createElement('a');
- toggle.href = 'javascript:void(0)';
- toggle.className = 'collapse-toggle';
- toggle.innerHTML = "[<span class='inner'>" + labelForToggleButton(false) + "</span>]";
-
- var func = function(e) {
- var next = e.nextElementSibling;
- if (hasClass(e, 'impl') && next && hasClass(next, 'docblock')) {
- next = next.nextElementSibling;
- }
- if (!next) {
- return;
- }
- if ((checkIfThereAreMethods(next.childNodes) || hasClass(e, 'method')) &&
- (hasClass(next, 'docblock') ||
- hasClass(e, 'impl') ||
- (hasClass(next, 'stability') &&
- hasClass(next.nextElementSibling, 'docblock')))) {
- insertAfter(toggle.cloneNode(true), e.childNodes[e.childNodes.length - 1]);
- }
- }
- onEach(document.getElementsByClassName('method'), func);
- onEach(document.getElementsByClassName('impl'), func);
- onEach(document.getElementsByClassName('impl-items'), function(e) {
- onEach(e.getElementsByClassName('associatedconstant'), func);
- });
-
- function createToggle(otherMessage) {
- var span = document.createElement('span');
- span.className = 'toggle-label';
- span.style.display = 'none';
- if (!otherMessage) {
- span.innerHTML = '&nbsp;Expand&nbsp;description';
- } else {
- span.innerHTML = otherMessage;
- span.style.fontSize = '20px';
- }
-
- var mainToggle = toggle.cloneNode(true);
- mainToggle.appendChild(span);
-
- var wrapper = document.createElement('div');
- wrapper.className = 'toggle-wrapper';
- wrapper.appendChild(mainToggle);
- return wrapper;
- }
-
- onEach(document.getElementById('main').getElementsByClassName('docblock'), function(e) {
- if (e.parentNode.id === "main") {
- var otherMessage;
- if (hasClass(e, "type-decl")) {
- otherMessage = '&nbsp;Show&nbsp;type&nbsp;declaration';
- }
- e.parentNode.insertBefore(createToggle(otherMessage), e);
- if (otherMessage) {
- collapseDocs(e.previousSibling.childNodes[0], "toggle");
- }
- }
- });
-
- onEach(document.getElementsByClassName('docblock'), function(e) {
- if (hasClass(e, 'autohide')) {
- var wrap = e.previousElementSibling;
- if (wrap && hasClass(wrap, 'toggle-wrapper')) {
- var toggle = wrap.childNodes[0];
- if (e.childNodes[0].tagName === 'H3') {
- onEach(toggle.getElementsByClassName('toggle-label'), function(i_e) {
- i_e.innerHTML = " Show " + e.childNodes[0].innerHTML;
- });
- }
- e.style.display = 'none';
- addClass(wrap, 'collapsed');
- onEach(toggle.getElementsByClassName('inner'), function(e) {
- e.innerHTML = labelForToggleButton(true);
- });
- onEach(toggle.getElementsByClassName('toggle-label'), function(e) {
- e.style.display = 'inline-block';
- });
- }
- }
- })
-
- autoCollapseAllImpls();
-
- function createToggleWrapper() {
- var span = document.createElement('span');
- span.className = 'toggle-label';
- span.style.display = 'none';
- span.innerHTML = '&nbsp;Expand&nbsp;attributes';
- toggle.appendChild(span);
-
- var wrapper = document.createElement('div');
- wrapper.className = 'toggle-wrapper toggle-attributes';
- wrapper.appendChild(toggle);
- return wrapper;
- }
-
- // In the search display, allows to switch between tabs.
- function printTab(nb) {
- if (nb === 0 || nb === 1 || nb === 2) {
- currentTab = nb;
- }
- var nb_copy = nb;
- onEach(document.getElementById('titles').childNodes, function(elem) {
- if (nb_copy === 0) {
- addClass(elem, 'selected');
- } else {
- removeClass(elem, 'selected');
- }
- nb_copy -= 1;
- });
- onEach(document.getElementById('results').childNodes, function(elem) {
- if (nb === 0) {
- elem.style.display = '';
- } else {
- elem.style.display = 'none';
- }
- nb -= 1;
- });
- }
-
- onEach(document.getElementById('main').getElementsByTagName('pre'), function(e) {
- onEach(e.getElementsByClassName('attributes'), function(i_e) {
- i_e.parentNode.insertBefore(createToggleWrapper(), i_e);
- collapseDocs(i_e.previousSibling.childNodes[0], "toggle");
- });
- });
-
- onEach(document.getElementsByClassName('rust-example-rendered'), function(e) {
- if (hasClass(e, 'compile_fail')) {
- e.addEventListener("mouseover", function(event) {
- e.previousElementSibling.childNodes[0].style.color = '#f00';
- });
- e.addEventListener("mouseout", function(event) {
- e.previousElementSibling.childNodes[0].style.color = '';
- });
- } else if (hasClass(e, 'ignore')) {
- e.addEventListener("mouseover", function(event) {
- e.previousElementSibling.childNodes[0].style.color = '#ff9200';
- });
- e.addEventListener("mouseout", function(event) {
- e.previousElementSibling.childNodes[0].style.color = '';
- });
- }
- });
-
- function showModal(content) {
- var modal = document.createElement('div');
- modal.id = "important";
- addClass(modal, 'modal');
- modal.innerHTML = '<div class="modal-content"><div class="close" id="modal-close">✕</div>' +
- '<div class="whiter"></div><span class="docblock">' + content +
- '</span></div>';
- document.getElementsByTagName('body')[0].appendChild(modal);
- document.getElementById('modal-close').onclick = hideModal;
- modal.onclick = hideModal;
- }
-
- function hideModal() {
- var modal = document.getElementById("important");
- if (modal) {
- modal.parentNode.removeChild(modal);
- }
- }
-
- onEach(document.getElementsByClassName('important-traits'), function(e) {
- e.onclick = function() {
- showModal(e.lastElementChild.innerHTML);
- };
- });
-
- var search_input = document.getElementsByClassName("search-input")[0];
-
- if (search_input) {
- search_input.onfocus = function() {
- if (search_input.value !== "") {
- addClass(document.getElementById("main"), "hidden");
- removeClass(document.getElementById("search"), "hidden");
- if (browserSupportsHistoryApi()) {
- history.replaceState(search_input.value,
- "",
- "?search=" + encodeURIComponent(search_input.value));
- }
- }
- };
- }
-
- var params = getQueryStringParams();
- if (params && params.search) {
- addClass(document.getElementById("main"), "hidden");
- var search = document.getElementById("search");
- removeClass(search, "hidden");
- search.innerHTML = '<h3 style="text-align: center;">Loading search results...</h3>';
- }
-
- var sidebar_menu = document.getElementsByClassName("sidebar-menu")[0];
- if (sidebar_menu) {
- sidebar_menu.onclick = function() {
- var sidebar = document.getElementsByClassName('sidebar')[0];
- if (hasClass(sidebar, "mobile") === true) {
- hideSidebar();
- } else {
- showSidebar();
- }
- };
- }
-
- window.onresize = function() {
- hideSidebar();
- };
-
- if (getCurrentValue("rustdoc-collapse") === "true") {
- toggleAllDocs();
- }
-}());
-
-// Sets the focus on the search bar at the top of the page
-function focusSearchBar() {
- document.getElementsByClassName('search-input')[0].focus();
-}
-
-// Removes the focus from the search bar
-function defocusSearchBar() {
- document.getElementsByClassName('search-input')[0].blur();
-}
diff --git a/target/doc/normalize.css b/target/doc/normalize.css
deleted file mode 100644
index 2804c26..0000000
--- a/target/doc/normalize.css
+++ /dev/null
@@ -1 +0,0 @@
-/*! normalize.css v3.0.0 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}
diff --git a/target/doc/rustdoc.css b/target/doc/rustdoc.css
deleted file mode 100644
index 31a501d..0000000
--- a/target/doc/rustdoc.css
+++ /dev/null
@@ -1,1293 +0,0 @@
-/**
- * Copyright 2013 The Rust Project Developers. See the COPYRIGHT
- * file at the top-level directory of this distribution and at
- * http://rust-lang.org/COPYRIGHT.
- *
- * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
- * http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
- * <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
- * option. This file may not be copied, modified, or distributed
- * except according to those terms.
- */
-
-/* See FiraSans-LICENSE.txt for the Fira Sans license. */
-@font-face {
- font-family: 'Fira Sans';
- font-style: normal;
- font-weight: 400;
- src: local('Fira Sans'), url("FiraSans-Regular.woff") format('woff');
-}
-@font-face {
- font-family: 'Fira Sans';
- font-style: normal;
- font-weight: 500;
- src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff');
-}
-
-/* See SourceSerifPro-LICENSE.txt for the Source Serif Pro license and
- * Heuristica-LICENSE.txt for the Heuristica license. */
-@font-face {
- font-family: 'Source Serif Pro';
- font-style: normal;
- font-weight: 400;
- src: local('Source Serif Pro'), url("SourceSerifPro-Regular.woff") format('woff');
-}
-@font-face {
- font-family: 'Source Serif Pro';
- font-style: italic;
- font-weight: 400;
- src: url("Heuristica-Italic.woff") format('woff');
-}
-@font-face {
- font-family: 'Source Serif Pro';
- font-style: normal;
- font-weight: 700;
- src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.woff") format('woff');
-}
-
-/* See SourceCodePro-LICENSE.txt for the Source Code Pro license. */
-@font-face {
- font-family: 'Source Code Pro';
- font-style: normal;
- font-weight: 400;
- /* Avoid using locally installed font because bad versions are in circulation:
- * see https://github.com/rust-lang/rust/issues/24355 */
- src: url("SourceCodePro-Regular.woff") format('woff');
-}
-@font-face {
- font-family: 'Source Code Pro';
- font-style: normal;
- font-weight: 600;
- src: url("SourceCodePro-Semibold.woff") format('woff');
-}
-
-* {
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-/* General structure and fonts */
-
-body {
- font: 16px/1.4 "Source Serif Pro", Georgia, Times, "Times New Roman", serif;
- margin: 0;
- position: relative;
- padding: 10px 15px 20px 15px;
-
- -webkit-font-feature-settings: "kern", "liga";
- -moz-font-feature-settings: "kern", "liga";
- font-feature-settings: "kern", "liga";
-}
-
-h1 {
- font-size: 1.5em;
-}
-h2 {
- font-size: 1.4em;
-}
-h3 {
- font-size: 1.3em;
-}
-h1, h2, h3:not(.impl):not(.method):not(.type):not(.tymethod):not(.important), h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
- font-weight: 500;
- margin: 20px 0 15px 0;
- padding-bottom: 6px;
-}
-h1.fqn {
- border-bottom: 1px dashed;
- margin-top: 0;
- position: relative;
-}
-h2, h3:not(.impl):not(.method):not(.type):not(.tymethod), h4:not(.method):not(.type):not(.tymethod):not(.associatedconstant) {
- border-bottom: 1px solid;
-}
-h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant {
- font-weight: 600;
- margin-top: 10px;
- margin-bottom: 10px;
- position: relative;
-}
-h3.impl, h3.method, h3.type {
- padding-left: 15px;
-}
-
-h1, h2, h3, h4,
-.sidebar, a.source, .search-input, .content table :not(code)>a,
-.collapse-toggle, ul.item-list > li > .out-of-band {
- font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
-}
-
-ol, ul {
- padding-left: 25px;
-}
-ul ul, ol ul, ul ol, ol ol {
- margin-bottom: 0;
-}
-
-p {
- margin: 0 0 .6em 0;
-}
-
-summary {
- outline: none;
-}
-
-code, pre {
- font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace;
- white-space: pre-wrap;
-}
-.docblock code, .docblock-short code {
- border-radius: 3px;
- padding: 0 0.2em;
-}
-.docblock pre code, .docblock-short pre code, .docblock code.spotlight {
- padding: 0;
-}
-.docblock code.spotlight :last-child {
- padding-bottom: 0.6em;
-}
-pre {
- padding: 14px;
-}
-
-.source .content pre {
- padding: 20px;
-}
-
-img {
- max-width: 100%;
-}
-
-.source .content {
- margin-top: 50px;
- max-width: none;
- overflow: visible;
- margin-left: 0px;
- min-width: 70em;
-}
-
-nav.sub {
- font-size: 16px;
- text-transform: uppercase;
-}
-
-.sidebar {
- width: 200px;
- position: fixed;
- left: 0;
- top: 0;
- height: 100vh;
- overflow: auto;
-}
-
-.sidebar .block > ul > li {
- margin-right: -10px;
-}
-
-.content, nav {
- max-width: 960px;
-}
-
-/* Everything else */
-
-.js-only, .hidden {
- display: none !important;
-}
-
-.sidebar img {
- margin: 20px auto;
- display: block;
- margin-top: 10px;
-}
-
-.sidebar .location {
- border: 1px solid;
- font-size: 17px;
- margin: 30px 10px 20px 10px;
- text-align: center;
- word-wrap: break-word;
-}
-
-.sidebar .version {
- font-size: 15px;
- text-align: center;
- border-bottom: 1px solid;
- overflow-wrap: break-word;
- word-wrap: break-word; /* deprecated */
- word-break: break-word; /* Chrome, non-standard */
-}
-
-.location:empty {
- border: none;
-}
-
-.location a:first-child {
- font-weight: 500;
-}
-
-.block {
- padding: 0;
- margin-bottom: 14px;
-}
-.block h2, .block h3 {
- margin-top: 0;
- margin-bottom: 8px;
- text-align: center;
-}
-.block ul, .block li {
- margin: 0 10px;
- padding: 0;
- list-style: none;
-}
-
-.block a {
- display: block;
- text-overflow: ellipsis;
- overflow: hidden;
- line-height: 15px;
- padding: 7px 5px;
- font-size: 14px;
- font-weight: 300;
- transition: border 500ms ease-out;
-}
-
-.sidebar-title {
- border-top: 1px solid;
- border-bottom: 1px solid;
- text-align: center;
- font-size: 17px;
- margin-bottom: 5px;
-}
-
-.sidebar-links {
- margin-bottom: 15px;
-}
-
-.sidebar-links > a {
- padding-left: 10px;
- width: 100%;
-}
-
-.sidebar-menu {
- display: none;
-}
-
-.content {
- padding: 15px 0;
-}
-
-.source .content pre.rust {
- white-space: pre;
- overflow: auto;
- padding-left: 0;
-}
-
-#search {
- margin-left: 230px;
- position: relative;
-}
-
-#results {
- position: absolute;
- right: 0;
- left: 0;
- overflow: auto;
-}
-
-#results > table {
- width: 100%;
- table-layout: fixed;
-}
-
-.content pre.line-numbers {
- float: left;
- border: none;
- position: relative;
-
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-.line-numbers span {
- cursor: pointer;
-}
-
-.docblock-short p {
- display: inline;
-}
-
-.docblock-short.nowrap {
- display: block;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
-}
-
-.docblock-short p {
- overflow: hidden;
- text-overflow: ellipsis;
- margin: 0;
-}
-.docblock-short code {
- white-space: nowrap;
-}
-
-.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
- border-bottom: 1px solid;
-}
-
-#main > .docblock h1 { font-size: 1.3em; }
-#main > .docblock h2 { font-size: 1.15em; }
-#main > .docblock h3, #main > .docblock h4, #main > .docblock h5 { font-size: 1em; }
-
-.docblock h1 { font-size: 1em; }
-.docblock h2 { font-size: 0.95em; }
-.docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
-
-.docblock {
- margin-left: 24px;
- position: relative;
-}
-
-.content .out-of-band {
- font-size: 23px;
- margin: 0px;
- padding: 0px;
- text-align: right;
- display: inline-block;
- font-weight: normal;
- position: absolute;
- right: 0;
-}
-
-h3.impl > .out-of-band {
- font-size: 21px;
-}
-
-h4.method > .out-of-band {
- font-size: 19px;
-}
-
-ul.item-list > li > .out-of-band {
- font-size: 19px;
-}
-
-h4 > code, h3 > code, .invisible > code {
- max-width: calc(100% - 41px);
- display: block;
-}
-
-.in-band, code {
- z-index: 5;
-}
-
-.invisible {
- width: 100%;
- display: inline-block;
-}
-
-.content .in-band {
- margin: 0px;
- padding: 0px;
-}
-
-.in-band > code {
- display: inline-block;
-}
-
-#main {
- position: relative;
-}
-#main > .since {
- top: inherit;
- font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
-}
-
-.content table:not(.table-display) {
- border-spacing: 0 5px;
- border-collapse: separate;
-}
-.content td { vertical-align: top; }
-.content td:first-child { padding-right: 20px; }
-.content td p:first-child { margin-top: 0; }
-.content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
-
-.docblock table {
- border: 1px solid;
- margin: .5em 0;
- border-collapse: collapse;
- width: 100%;
-}
-
-.docblock table td {
- padding: .5em;
- border-top: 1px dashed;
- border-bottom: 1px dashed;
-}
-
-.docblock table th {
- padding: .5em;
- text-align: left;
- border-top: 1px solid;
- border-bottom: 1px solid;
-}
-
-.fields + table {
- margin-bottom: 1em;
-}
-
-.content .item-list {
- list-style-type: none;
- padding: 0;
-}
-
-.content .item-list li {
- margin-bottom: 1em;
-}
-
-.content .multi-column {
- -moz-column-count: 5;
- -moz-column-gap: 2.5em;
- -webkit-column-count: 5;
- -webkit-column-gap: 2.5em;
- column-count: 5;
- column-gap: 2.5em;
-}
-.content .multi-column li { width: 100%; display: inline-block; }
-
-.content .method {
- font-size: 1em;
- position: relative;
-}
-/* Shift "where ..." part of method or fn definition down a line */
-.content .method .where,
-.content .fn .where,
-.content .where.fmt-newline {
- display: block;
- font-size: 0.8em;
-}
-
-.content .methods > div:not(.important-traits) {
- margin-left: 40px;
- margin-bottom: 15px;
-}
-
-.content .impl-items .docblock, .content .impl-items .stability {
- margin-bottom: .6em;
-}
-.content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
- margin-left: 20px;
-}
-
-.content .stability code {
- font-size: 90%;
-}
-
-nav {
- border-bottom: 1px solid;
- padding-bottom: 10px;
- margin-bottom: 10px;
-}
-nav.main {
- padding: 20px 0;
- text-align: center;
-}
-nav.main .current {
- border-top: 1px solid;
- border-bottom: 1px solid;
-}
-nav.main .separator {
- border: 1px solid;
- display: inline-block;
- height: 23px;
- margin: 0 20px;
-}
-nav.sum { text-align: right; }
-nav.sub form { display: inline; }
-
-nav.sub, .content {
- margin-left: 230px;
-}
-
-a {
- text-decoration: none;
- background: transparent;
-}
-
-.small-section-header:hover > .anchor {
- display: initial;
-}
-
-.in-band:hover > .anchor {
- display: inline-block;
- position: absolute;
-}
-.anchor {
- display: none;
- position: absolute;
- left: -7px;
-}
-.anchor.field {
- left: -5px;
-}
-.small-section-header > .anchor {
- left: -28px;
-}
-.anchor:before {
- content: '\2002\00a7\2002';
-}
-
-.docblock a:hover, .docblock-short a:hover, .stability a {
- text-decoration: underline;
-}
-
-.block a.current.crate { font-weight: 500; }
-
-.search-input {
- width: 100%;
- /* Override Normalize.css: we have margins and do
- not want to overflow - the `moz` attribute is necessary
- until Firefox 29, too early to drop at this point */
- -moz-box-sizing: border-box !important;
- box-sizing: border-box !important;
- outline: none;
- border: none;
- border-radius: 1px;
- margin-top: 5px;
- padding: 10px 16px;
- font-size: 17px;
- transition: border-color 300ms ease;
- transition: border-radius 300ms ease-in-out;
- transition: box-shadow 300ms ease-in-out;
-}
-
-.search-input:focus {
- border-radius: 2px;
- border: 0;
- outline: 0;
- box-shadow: 0 0 8px #078dd8;
-}
-
-.search-results .desc {
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- display: block;
-}
-
-.search-results a {
- display: block;
-}
-
-.content .search-results td:first-child {
- padding-right: 0;
- width: 75%;
-}
-.content .search-results td:first-child a {
- padding-right: 10px;
-}
-.content .search-results td:first-child a span {
- float: left;
-}
-
-tr.result span.primitive::after {
- content: ' (primitive type)';
- font-style: italic;
-}
-
-body.blur > :not(#help) {
- filter: blur(8px);
- -webkit-filter: blur(8px);
- opacity: .7;
-}
-
-#help {
- width: 100%;
- height: 100vh;
- position: fixed;
- top: 0;
- left: 0;
- display: flex;
- justify-content: center;
- align-items: center;
-}
-#help > div {
- flex: 0 0 auto;
- box-shadow: 0 0 6px rgba(0,0,0,.2);
- width: 550px;
- height: auto;
- border: 1px solid;
-}
-#help dt {
- float: left;
- clear: left;
- display: block;
-}
-#help dd { margin: 5px 35px; }
-#help .infos { padding-left: 0; }
-#help h1, #help h2 { margin-top: 0; }
-#help > div div {
- width: 50%;
- float: left;
- padding: 20px;
- padding-left: 17px;
-}
-
-.stab {
- display: table;
- border-width: 1px;
- border-style: solid;
- padding: 3px;
- margin-bottom: 5px;
- font-size: 90%;
-}
-.stab p {
- display: inline;
-}
-
-.stab summary {
- display: list-item;
-}
-
-.stab .microscope {
- font-size: 1.5em;
-}
-
-.module-item .stab {
- display: inline;
- border-width: 0;
- padding: 0;
- margin: 0;
- background: inherit !important;
-}
-
-.module-item.unstable {
- opacity: 0.65;
-}
-
-.since {
- font-weight: normal;
- font-size: initial;
- position: absolute;
- right: 0;
- top: 0;
-}
-
-.variants_table {
- width: 100%;
-}
-
-.variants_table tbody tr td:first-child {
- width: 1%; /* make the variant name as small as possible */
-}
-
-td.summary-column {
- width: 100%;
-}
-
-.summary {
- padding-right: 0px;
-}
-
-pre.rust .question-mark {
- font-weight: bold;
-}
-
-a.test-arrow {
- display: inline-block;
- position: absolute;
- padding: 5px 10px 5px 10px;
- border-radius: 5px;
- font-size: 130%;
- top: 5px;
- right: 5px;
-}
-a.test-arrow:hover{
- text-decoration: none;
-}
-
-.section-header:hover a:before {
- position: absolute;
- left: -25px;
- content: '\2002\00a7\2002';
-}
-
-.section-header:hover a {
- text-decoration: none;
-}
-
-.section-header a {
- color: inherit;
-}
-
-.collapse-toggle {
- font-weight: 300;
- position: absolute;
- left: -23px;
- top: 0;
-}
-
-h3 > .collapse-toggle, h4 > .collapse-toggle {
- font-size: 0.8em;
- top: 5px;
-}
-
-.toggle-wrapper > .collapse-toggle {
- left: -24px;
- margin-top: 0px;
-}
-
-.toggle-wrapper {
- position: relative;
- margin-top: 5px;
-}
-
-.toggle-wrapper.collapsed {
- height: 25px;
- transition: height .2s;
- margin-bottom: .6em;
-}
-
-.collapse-toggle > .inner {
- display: inline-block;
- width: 1.2ch;
- text-align: center;
-}
-
-.ghost {
- display: none;
-}
-
-.ghost + .since {
- position: initial;
- display: table-cell;
-}
-
-.since + .srclink {
- display: table-cell;
- padding-left: 10px;
-}
-
-.item-spacer {
- width: 100%;
- height: 12px;
-}
-
-span.since {
- position: initial;
- font-size: 20px;
- margin-right: 5px;
-}
-
-.toggle-wrapper > .collapse-toggle {
- left: 0;
-}
-
-.variant + .toggle-wrapper + .docblock > p {
- margin-top: 5px;
-}
-
-.sub-variant, .sub-variant > h3 {
- margin-top: 0 !important;
-}
-
-.toggle-label {
- display: inline-block;
- margin-left: 4px;
- margin-top: 3px;
-}
-
-.enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
- margin-left: 30px;
- margin-bottom: 20px;
- margin-top: 5px;
-}
-
-.docblock > .section-header:first-child {
- margin-left: 15px;
- margin-top: 0;
-}
-
-.docblock > .section-header:first-child:hover > a:before {
- left: -10px;
-}
-
-.enum > .collapsed, .struct > .collapsed {
- margin-bottom: 25px;
-}
-
-#main > .variant, #main > .structfield {
- display: block;
-}
-
-.attributes {
- display: block;
- margin: 0px 0px 0px 30px !important;
-}
-.toggle-attributes.collapsed {
- margin-bottom: 5px;
-}
-
-:target > code {
- opacity: 1;
-}
-
-/* Media Queries */
-
-@media (max-width: 700px) {
- body {
- padding-top: 0px;
- }
-
- .sidebar {
- height: 45px;
- min-height: 40px;
- width: calc(100% + 30px);
- margin: 0;
- margin-left: -15px;
- padding: 0 15px;
- position: static;
- z-index: 1;
- }
-
- .sidebar > .location {
- float: right;
- margin: 0px;
- margin-top: 2px;
- padding: 3px 10px 1px 10px;
- min-height: 39px;
- background: inherit;
- text-align: left;
- font-size: 24px;
- }
-
- .sidebar .location:empty {
- padding: 0;
- }
-
- .sidebar img {
- width: 35px;
- margin-top: 5px;
- margin-bottom: 5px;
- float: left;
- margin-left: 50px;
- }
-
- .sidebar-menu {
- position: fixed;
- z-index: 10;
- font-size: 2rem;
- cursor: pointer;
- width: 45px;
- left: 0;
- text-align: center;
- display: block;
- border-bottom: 1px solid;
- border-right: 1px solid;
- height: 45px;
- }
-
- .sidebar-elems {
- position: fixed;
- z-index: 1;
- left: 0;
- top: 45px;
- bottom: 0;
- overflow-y: auto;
- border-right: 1px solid;
- display: none;
- }
-
- .sidebar > .block.version {
- border-bottom: none;
- margin-top: 12px;
- }
-
- nav.sub {
- width: calc(100% - 32px);
- float: right;
- }
-
- .content {
- margin-left: 0px;
- }
-
- #main {
- margin-top: 45px;
- padding: 0;
- }
-
- .content .in-band {
- width: 100%;
- }
-
- .content h4 > .out-of-band {
- position: inherit;
- }
-
- .toggle-wrapper > .collapse-toggle {
- left: 0px;
- }
-
- .toggle-wrapper {
- height: 1.5em;
- }
-
- #search {
- margin-left: 0;
- }
-
- .content .impl-items .method, .content .impl-items > .type, .impl-items > .associatedconstant {
- display: flex;
- }
-
- .anchor {
- display: none !important;
- }
-}
-
-@media print {
- nav.sub, .content .out-of-band, .collapse-toggle {
- display: none;
- }
-}
-
-.information {
- position: absolute;
- left: -20px;
- margin-top: 7px;
- z-index: 1;
-}
-
-.tooltip {
- position: relative;
- display: inline-block;
- cursor: pointer;
-}
-
-.tooltip .tooltiptext {
- width: 120px;
- display: none;
- text-align: center;
- padding: 5px 3px;
- border-radius: 6px;
- margin-left: 5px;
- top: -5px;
- left: 105%;
- z-index: 1;
-}
-
-.tooltip:hover .tooltiptext {
- display: inline;
-}
-
-.tooltip .tooltiptext::after {
- content: " ";
- position: absolute;
- top: 50%;
- left: 11px;
- margin-top: -5px;
- border-width: 5px;
- border-style: solid;
-}
-
-.important-traits .tooltip .tooltiptext {
- border: 1px solid;
-}
-
-pre.rust {
- position: relative;
-}
-
-.search-failed {
- text-align: center;
- margin-top: 20px;
-}
-
-#titles {
- height: 35px;
-}
-
-#titles > div {
- float: left;
- width: 33.3%;
- text-align: center;
- border-bottom: 1px solid;
- font-size: 18px;
- cursor: pointer;
-}
-
-#titles > div.selected {
- border-bottom: 3px solid;
-}
-
-#titles > div:hover {
- border-bottom: 3px solid;
-}
-
-#titles > div > div.count {
- display: inline-block;
- font-size: 16px;
-}
-
-.important-traits {
- cursor: pointer;
- z-index: 2;
-}
-
-h4 > .important-traits {
- position: absolute;
- left: -44px;
- top: 2px;
-}
-
-@media (max-width: 700px) {
- h4 > .important-traits {
- position: absolute;
- left: -22px;
- top: 24px;
- }
-
- #titles > div > div.count {
- float: left;
- width: 100%;
- }
-
- #titles {
- height: 50px;
- }
-
- .sidebar.mobile {
- position: fixed;
- width: 100%;
- margin-left: 0;
- background-color: rgba(0,0,0,0);
- height: 100%;
- }
-
- .show-it {
- display: block;
- width: 246px;
- }
-
- .show-it > .block.items {
- margin: 8px 0;
- }
-
- .show-it > .block.items > ul {
- margin: 0;
- }
-
- .show-it > .block.items > ul > li {
- text-align: center;
- margin: 2px 0;
- }
-
- .show-it > .block.items > ul > li > a {
- font-size: 21px;
- }
-
- /* Because of ios, we need to actually have a full height sidebar title so the
- * actual sidebar can show up. But then we need to make it transparent so we don't
- * hide content. The filler just allows to create the background for the sidebar
- * title. But because of the absolute position, I had to lower the z-index.
- */
- #sidebar-filler {
- position: fixed;
- left: 45px;
- width: calc(100% - 45px);
- top: 0;
- height: 45px;
- z-index: -1;
- border-bottom: 1px solid;
- }
-
- .collapse-toggle {
- left: -20px;
- }
-
- .impl > .collapse-toggle {
- left: -10px;
- }
-}
-
-
-@media (max-width: 416px) {
- #titles {
- height: 73px;
- }
-
- #titles > div {
- height: 73px;
- }
-}
-
-.modal {
- position: fixed;
- width: 100vw;
- height: 100vh;
- z-index: 10000;
- top: 0;
- left: 0;
-}
-
-.modal-content {
- display: block;
- max-width: 60%;
- min-width: 200px;
- padding: 8px;
- top: 40%;
- position: absolute;
- left: 50%;
- transform: translate(-50%, -40%);
- border: 1px solid;
- border-radius: 4px;
- border-top-right-radius: 0;
-}
-
-.modal-content > .docblock {
- margin: 0;
-}
-
-h3.important {
- margin: 0;
- margin-bottom: 13px;
- font-size: 19px;
-}
-
-.modal-content > .docblock > code.content {
- margin: 0;
- padding: 0;
- font-size: 20px;
-}
-
-.modal-content > .close {
- position: absolute;
- font-weight: 900;
- right: -25px;
- top: -1px;
- font-size: 18px;
- width: 25px;
- padding-right: 2px;
- border-top-right-radius: 5px;
- border-bottom-right-radius: 5px;
- text-align: center;
- border: 1px solid;
- border-right: 0;
- cursor: pointer;
-}
-
-.modal-content > .whiter {
- height: 25px;
- position: absolute;
- width: 3px;
- right: -2px;
- top: 0px;
-}
-
-#main > div.important-traits {
- position: absolute;
- left: -24px;
- margin-top: 16px;
-}
-
-.content > .methods > div.important-traits {
- position: absolute;
- left: -42px;
- margin-top: 2px;
-}
-
-kbd {
- display: inline-block;
- padding: 3px 5px;
- font: 15px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
- line-height: 10px;
- vertical-align: middle;
- border: solid 1px;
- border-radius: 3px;
- box-shadow: inset 0 -1px 0;
- cursor: default;
-}
-
-.theme-picker {
- position: absolute;
- left: 211px;
- top: 19px;
-}
-
-.theme-picker button {
- outline: none;
-}
-
-#theme-picker {
- padding: 4px;
- width: 27px;
- height: 29px;
- border: 1px solid;
- border-radius: 3px;
- cursor: pointer;
-}
-
-#theme-choices {
- display: none;
- position: absolute;
- left: 0;
- top: 28px;
- border: 1px solid;
- border-radius: 3px;
- z-index: 1;
- cursor: pointer;
-}
-
-#theme-choices > button {
- border: none;
- width: 100%;
- padding: 4px;
- text-align: center;
- background: rgba(0,0,0,0);
-}
-
-#theme-choices > button:not(:first-child) {
- border-top: 1px solid;
-}
-
-@media (max-width: 700px) {
- .theme-picker {
- left: 10px;
- top: 54px;
- z-index: 1;
- }
-}
-
-.hidden-by-impl-hider,
-.hidden-by-usual-hider {
- /* important because of conflicting rule for small screens */
- display: none !important;
-}
-
-#implementations-list > h3 > span.in-band {
- width: 100%;
-}
-
-.table-display {
- width: 100%;
- border: 0;
- border-collapse: collapse;
- border-spacing: 0;
- font-size: 16px;
-}
-
-.table-display tr td:first-child {
- padding-right: 0;
-}
-
-.table-display tr td:last-child {
- float: right;
-}
-.table-display .out-of-band {
- position: relative;
- font-size: 19px;
- display: block;
-}
diff --git a/target/doc/search-index.js b/target/doc/search-index.js
deleted file mode 100644
index a5d30b7..0000000
--- a/target/doc/search-index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-var searchIndex = {};
-searchIndex["mailparse"] = {"doc":"","items":[[3,"MailHeader","mailparse","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.",null,null],[3,"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.",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\" or \"utf-8\".",0,null],[12,"params","","The additional params of Content-Type, e.g. filename and boundary. The keys in the map will be lowercased, and the values will have any enclosing quotes stripped.",0,null],[3,"ParsedContentDisposition","","A struct to hold a more structured representation of the Content-Disposition header. This is provided mostly as a convenience since this metadata is usually needed to interpret the message body properly.",null,null],[12,"disposition","","The disposition type of the Content-Disposition header. If this is an extension type, the string will be lowercased.",1,null],[12,"params","","The additional params of Content-Disposition, e.g. filename. The keys in the map will be lowercased, and the values will have any enclosing quotes stripped.",1,null],[3,"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.",null,null],[12,"headers","","The headers for the message (or message subpart).",2,null],[12,"ctype","","The Content-Type information for the message (or message subpart).",2,null],[12,"subparts","","The subparts of this message or subpart. This vector is only non-empty if ctype.mimetype starts with \"multipart/\".",2,null],[4,"MailParseError","","An error type that represents the different kinds of errors that may be encountered during message parsing.",null,null],[13,"QuotedPrintableDecodeError","","Data that was specified as being in the quoted-printable transfer-encoding could not be successfully decoded as quoted-printable data.",3,null],[13,"Base64DecodeError","","Data that was specified as being in the base64 transfer-encoding could not be successfully decoded as base64 data.",3,null],[13,"EncodingError","","An error occurred when converting the raw byte data to Rust UTF-8 string format using the charset specified in the message.",3,null],[13,"Generic","","Some other error occurred while parsing the message; the description string provides additional details.",3,null],[4,"DispositionType","","The possible disposition types in a Content-Disposition header. A more comprehensive list of IANA-recognized types can be found at https://www.iana.org/assignments/cont-disp/cont-disp.xhtml. This library only enumerates the types most commonly found in email messages, and provides the `Extension` value for holding all other types.",null,null],[13,"Inline","","Default value, indicating the content is to be displayed inline as part of the enclosing document.",4,null],[13,"Attachment","","A disposition indicating the content is not meant for inline display, but whose content can be accessed for use.",4,null],[13,"FormData","","A disposition indicating the content contains a form submission.",4,null],[13,"Extension","","Extension type to hold any disposition not explicitly enumerated.",4,null],[5,"dateparse","","Convert a date field from an email header into a UNIX epoch timestamp. This function handles the most common formatting of date fields found in email headers. It may fail to parse some of the more creative formattings.",null,{"inputs":[{"name":"str"}],"output":{"generics":["i64","str"],"name":"result"}}],[5,"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 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.",null,null],[5,"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 headers and returns them in a vector. The normal vector functions can be used to access the headers linearly, or the MailHeaderMap trait can be used to access them in a map-like fashion. Along with this vector, the function 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.",null,null],[5,"parse_content_type","","Helper method to parse a header value as a Content-Type header. Note that the returned object's `params` map will contain a charset key if a charset was explicitly specified in the header; otherwise the `params` map will not contain a charset key. Regardless, the `charset` field will contain a charset - either the one explicitly specified or the default of \"us-ascii\".",null,{"inputs":[{"name":"str"}],"output":{"name":"parsedcontenttype"}}],[5,"parse_content_disposition","","Helper method to parse a header value as a Content-Disposition header. The disposition defaults to \"inline\" if no disposition parameter is provided in the header value.",null,{"inputs":[{"name":"str"}],"output":{"name":"parsedcontentdisposition"}}],[5,"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.",null,null],[8,"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.",null,null],[10,"get_first_value","","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 names are matched case-insensitively.",5,{"inputs":[{"name":"self"},{"name":"str"}],"output":{"generics":["option","mailparseerror"],"name":"result"}}],[10,"get_all_values","","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. Header names are matched case-insensitively.",5,{"inputs":[{"name":"self"},{"name":"str"}],"output":{"generics":["vec","mailparseerror"],"name":"result"}}],[11,"fmt","","",3,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"fmt","","",3,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"description","","",3,{"inputs":[{"name":"self"}],"output":{"name":"str"}}],[11,"cause","","",3,{"inputs":[{"name":"self"}],"output":{"generics":["error"],"name":"option"}}],[11,"from","","",3,{"inputs":[{"name":"quotedprintableerror"}],"output":{"name":"mailparseerror"}}],[11,"from","","",3,{"inputs":[{"name":"decodeerror"}],"output":{"name":"mailparseerror"}}],[11,"from","","",3,{"inputs":[{"generics":["str"],"name":"cow"}],"output":{"name":"mailparseerror"}}],[11,"fmt","","",6,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"get_key","","Get the name of the header. Note that header names are case-insensitive.",6,{"inputs":[{"name":"self"}],"output":{"generics":["string","mailparseerror"],"name":"result"}}],[11,"get_value","","Get the value of the header. Any sequences of newlines characters followed by whitespace are collapsed into a single space. In effect, header values wrapped across multiple lines are compacted back into one line, while discarding the extra whitespace required by the MIME format. Additionally, any quoted-printable words in the value are decoded.",6,{"inputs":[{"name":"self"}],"output":{"generics":["string","mailparseerror"],"name":"result"}}],[11,"fmt","","",0,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"default","","",0,{"inputs":[],"output":{"name":"self"}}],[11,"fmt","","",4,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"clone","","",4,{"inputs":[{"name":"self"}],"output":{"name":"dispositiontype"}}],[11,"eq","","",4,{"inputs":[{"name":"self"},{"name":"dispositiontype"}],"output":{"name":"bool"}}],[11,"ne","","",4,{"inputs":[{"name":"self"},{"name":"dispositiontype"}],"output":{"name":"bool"}}],[11,"default","","",4,{"inputs":[],"output":{"name":"self"}}],[11,"fmt","","",1,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"default","","",1,{"inputs":[],"output":{"name":"parsedcontentdisposition"}}],[11,"fmt","","",2,{"inputs":[{"name":"self"},{"name":"formatter"}],"output":{"name":"result"}}],[11,"get_body","","Get the body of the message as a Rust string. This function tries to unapply the Content-Transfer-Encoding if there is one, and then converts the result into a Rust UTF-8 string using the charset in the Content-Type (or \"us-ascii\" if the charset was missing or not recognized).",2,{"inputs":[{"name":"self"}],"output":{"generics":["string","mailparseerror"],"name":"result"}}],[11,"get_body_raw","","Get the body of the message as a Rust Vec. This function tries to unapply the Content-Transfer-Encoding if there is one, but won't do any charset decoding.",2,{"inputs":[{"name":"self"}],"output":{"generics":["vec","mailparseerror"],"name":"result"}}],[11,"get_content_disposition","","Returns a struct containing a parsed representation of the Content-Disposition header. The first header with this name is used, if there are multiple. See the `parse_content_disposition` method documentation for more details on the semantics of the returned object.",2,{"inputs":[{"name":"self"}],"output":{"generics":["parsedcontentdisposition","mailparseerror"],"name":"result"}}]],"paths":[[3,"ParsedContentType"],[3,"ParsedContentDisposition"],[3,"ParsedMail"],[4,"MailParseError"],[4,"DispositionType"],[8,"MailHeaderMap"],[3,"MailHeader"]]};
-initSearch(searchIndex);
diff --git a/target/doc/src/mailparse/dateparse.rs.html b/target/doc/src/mailparse/dateparse.rs.html
deleted file mode 100644
index dd2021d..0000000
--- a/target/doc/src/mailparse/dateparse.rs.html
+++ /dev/null
@@ -1,544 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="generator" content="rustdoc">
- <meta name="description" content="Source to the Rust file `src/dateparse.rs`.">
- <meta name="keywords" content="rust, rustlang, rust-lang">
-
- <title>dateparse.rs.html -- source</title>
-
- <link rel="stylesheet" type="text/css" href="../../normalize.css">
- <link rel="stylesheet" type="text/css" href="../../rustdoc.css"
- id="mainThemeStyle">
-
- <link rel="stylesheet" type="text/css" href="../../dark.css">
- <link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle">
- <script src="../../storage.js"></script>
-
-
-
-
-</head>
-<body class="rustdoc source">
- <!--[if lte IE 8]>
- <div class="warning">
- This old browser is unsupported and will most likely display funky
- things.
- </div>
- <![endif]-->
-
-
-
- <nav class="sidebar">
- <div class="sidebar-menu">&#9776;</div>
-
-
- </nav>
-
- <div class="theme-picker">
- <button id="theme-picker" aria-label="Pick another theme!">
- <img src="../../brush.svg" width="18" alt="Pick another theme!">
- </button>
- <div id="theme-choices"></div>
- </div>
- <script src="../../theme.js"></script>
- <nav class="sub">
- <form class="search-form js-only">
- <div class="search-container">
- <input class="search-input" name="search"
- autocomplete="off"
- placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
- type="search">
- </div>
- </form>
- </nav>
-
- <section id='main' class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100">100</span>
-<span id="101">101</span>
-<span id="102">102</span>
-<span id="103">103</span>
-<span id="104">104</span>
-<span id="105">105</span>
-<span id="106">106</span>
-<span id="107">107</span>
-<span id="108">108</span>
-<span id="109">109</span>
-<span id="110">110</span>
-<span id="111">111</span>
-<span id="112">112</span>
-<span id="113">113</span>
-<span id="114">114</span>
-<span id="115">115</span>
-<span id="116">116</span>
-<span id="117">117</span>
-<span id="118">118</span>
-<span id="119">119</span>
-<span id="120">120</span>
-<span id="121">121</span>
-<span id="122">122</span>
-<span id="123">123</span>
-<span id="124">124</span>
-<span id="125">125</span>
-<span id="126">126</span>
-<span id="127">127</span>
-<span id="128">128</span>
-<span id="129">129</span>
-<span id="130">130</span>
-<span id="131">131</span>
-<span id="132">132</span>
-<span id="133">133</span>
-<span id="134">134</span>
-<span id="135">135</span>
-<span id="136">136</span>
-<span id="137">137</span>
-<span id="138">138</span>
-<span id="139">139</span>
-<span id="140">140</span>
-<span id="141">141</span>
-<span id="142">142</span>
-<span id="143">143</span>
-<span id="144">144</span>
-<span id="145">145</span>
-<span id="146">146</span>
-<span id="147">147</span>
-<span id="148">148</span>
-<span id="149">149</span>
-<span id="150">150</span>
-<span id="151">151</span>
-<span id="152">152</span>
-<span id="153">153</span>
-<span id="154">154</span>
-<span id="155">155</span>
-<span id="156">156</span>
-<span id="157">157</span>
-<span id="158">158</span>
-<span id="159">159</span>
-<span id="160">160</span>
-<span id="161">161</span>
-<span id="162">162</span>
-<span id="163">163</span>
-<span id="164">164</span>
-<span id="165">165</span>
-<span id="166">166</span>
-<span id="167">167</span>
-<span id="168">168</span>
-<span id="169">169</span>
-<span id="170">170</span>
-<span id="171">171</span>
-<span id="172">172</span>
-<span id="173">173</span>
-<span id="174">174</span>
-<span id="175">175</span>
-<span id="176">176</span>
-<span id="177">177</span>
-<span id="178">178</span>
-<span id="179">179</span>
-<span id="180">180</span>
-<span id="181">181</span>
-<span id="182">182</span>
-<span id="183">183</span>
-<span id="184">184</span>
-<span id="185">185</span>
-<span id="186">186</span>
-<span id="187">187</span>
-<span id="188">188</span>
-<span id="189">189</span>
-<span id="190">190</span>
-<span id="191">191</span>
-<span id="192">192</span>
-<span id="193">193</span>
-<span id="194">194</span>
-<span id="195">195</span>
-<span id="196">196</span>
-<span id="197">197</span>
-<span id="198">198</span>
-<span id="199">199</span>
-<span id="200">200</span>
-<span id="201">201</span>
-<span id="202">202</span>
-<span id="203">203</span>
-<span id="204">204</span>
-<span id="205">205</span>
-<span id="206">206</span>
-<span id="207">207</span>
-<span id="208">208</span>
-<span id="209">209</span>
-<span id="210">210</span>
-</pre><pre class="rust ">
-<span class="kw">enum</span> <span class="ident">DateParseState</span> {
- <span class="ident">Date</span>,
- <span class="ident">Month</span>,
- <span class="ident">Year</span>,
- <span class="ident">Hour</span>,
- <span class="ident">Minute</span>,
- <span class="ident">Second</span>,
- <span class="ident">Timezone</span>,
-}
-
-<span class="kw">fn</span> <span class="ident">days_in_month</span>(<span class="ident">month</span>: <span class="ident">i64</span>, <span class="ident">year</span>: <span class="ident">i64</span>) <span class="op">-&gt;</span> <span class="ident">i64</span> {
- <span class="kw">match</span> <span class="ident">month</span> {
- <span class="number">0</span> <span class="op">|</span> <span class="number">2</span> <span class="op">|</span> <span class="number">4</span> <span class="op">|</span> <span class="number">6</span> <span class="op">|</span> <span class="number">7</span> <span class="op">|</span> <span class="number">9</span> <span class="op">|</span> <span class="number">11</span> <span class="op">=&gt;</span> <span class="number">31</span>,
- <span class="number">3</span> <span class="op">|</span> <span class="number">5</span> <span class="op">|</span> <span class="number">8</span> <span class="op">|</span> <span class="number">10</span> <span class="op">=&gt;</span> <span class="number">30</span>,
- <span class="number">1</span> <span class="op">=&gt;</span> {
- <span class="kw">if</span> (<span class="ident">year</span> <span class="op">%</span> <span class="number">400</span>) <span class="op">==</span> <span class="number">0</span> {
- <span class="number">29</span>
- } <span class="kw">else</span> <span class="kw">if</span> (<span class="ident">year</span> <span class="op">%</span> <span class="number">100</span>) <span class="op">==</span> <span class="number">0</span> {
- <span class="number">28</span>
- } <span class="kw">else</span> <span class="kw">if</span> (<span class="ident">year</span> <span class="op">%</span> <span class="number">4</span>) <span class="op">==</span> <span class="number">0</span> {
- <span class="number">29</span>
- } <span class="kw">else</span> {
- <span class="number">28</span>
- }
- }
- <span class="kw">_</span> <span class="op">=&gt;</span> <span class="number">0</span>,
- }
-}
-
-<span class="kw">fn</span> <span class="ident">seconds_to_date</span>(<span class="ident">year</span>: <span class="ident">i64</span>, <span class="ident">month</span>: <span class="ident">i64</span>, <span class="ident">day</span>: <span class="ident">i64</span>) <span class="op">-&gt;</span> <span class="ident">i64</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">result</span>: <span class="ident">i64</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="kw">for</span> <span class="ident">y</span> <span class="kw">in</span> <span class="number">1970</span>..<span class="number">2001</span> {
- <span class="kw">if</span> <span class="ident">y</span> <span class="op">==</span> <span class="ident">year</span> {
- <span class="kw">break</span>;
- }
- <span class="ident">result</span> <span class="op">+=</span> <span class="number">86400</span> <span class="op">*</span> <span class="number">365</span>;
- <span class="kw">if</span> (<span class="ident">y</span> <span class="op">%</span> <span class="number">4</span>) <span class="op">==</span> <span class="number">0</span> {
- <span class="ident">result</span> <span class="op">+=</span> <span class="number">86400</span>;
- }
- }
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">y</span> <span class="op">=</span> <span class="number">2001</span>;
- <span class="kw">while</span> <span class="ident">y</span> <span class="op">&lt;</span> <span class="ident">year</span> {
- <span class="kw">if</span> <span class="ident">year</span> <span class="op">-</span> <span class="ident">y</span> <span class="op">&gt;=</span> <span class="number">400</span> {
- <span class="ident">result</span> <span class="op">+=</span> (<span class="number">86400</span> <span class="op">*</span> <span class="number">365</span> <span class="op">*</span> <span class="number">400</span>) <span class="op">+</span> (<span class="number">86400</span> <span class="op">*</span> <span class="number">97</span>);
- <span class="ident">y</span> <span class="op">+=</span> <span class="number">400</span>;
- <span class="kw">continue</span>;
- }
- <span class="kw">if</span> <span class="ident">year</span> <span class="op">-</span> <span class="ident">y</span> <span class="op">&gt;=</span> <span class="number">100</span> {
- <span class="ident">result</span> <span class="op">+=</span> (<span class="number">86400</span> <span class="op">*</span> <span class="number">365</span> <span class="op">*</span> <span class="number">100</span>) <span class="op">+</span> (<span class="number">86400</span> <span class="op">*</span> <span class="number">24</span>);
- <span class="ident">y</span> <span class="op">+=</span> <span class="number">100</span>;
- <span class="kw">continue</span>;
- }
- <span class="kw">if</span> <span class="ident">year</span> <span class="op">-</span> <span class="ident">y</span> <span class="op">&gt;=</span> <span class="number">4</span> {
- <span class="ident">result</span> <span class="op">+=</span> (<span class="number">86400</span> <span class="op">*</span> <span class="number">365</span> <span class="op">*</span> <span class="number">4</span>) <span class="op">+</span> (<span class="number">86400</span>);
- <span class="ident">y</span> <span class="op">+=</span> <span class="number">4</span>;
- <span class="kw">continue</span>;
- }
- <span class="ident">result</span> <span class="op">+=</span> <span class="number">86400</span> <span class="op">*</span> <span class="number">365</span>;
- <span class="ident">y</span> <span class="op">+=</span> <span class="number">1</span>;
- }
- <span class="kw">for</span> <span class="ident">m</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">month</span> {
- <span class="ident">result</span> <span class="op">+=</span> <span class="number">86400</span> <span class="op">*</span> <span class="ident">days_in_month</span>(<span class="ident">m</span>, <span class="ident">year</span>)
- }
- <span class="ident">result</span> <span class="op">+</span> <span class="number">86400</span> <span class="op">*</span> (<span class="ident">day</span> <span class="op">-</span> <span class="number">1</span>)
-}
-
-<span class="doccomment">/// Convert a date field from an email header into a UNIX epoch timestamp.</span>
-<span class="doccomment">/// This function handles the most common formatting of date fields found in</span>
-<span class="doccomment">/// email headers. It may fail to parse some of the more creative formattings.</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// # Examples</span>
-<span class="doccomment">/// ```</span>
-<span class="doccomment">/// use mailparse::dateparse;</span>
-<span class="doccomment">/// assert_eq!(dateparse(&quot;Sun, 02 Oct 2016 07:06:22 -0700 (PDT)&quot;).unwrap(), 1475417182);</span>
-<span class="doccomment">/// ```</span>
-<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">dateparse</span>(<span class="ident">date</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">i64</span>, <span class="kw-2">&amp;</span><span class="lifetime">&#39;static</span> <span class="ident">str</span><span class="op">&gt;</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">result</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">month</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">day_of_month</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">state</span> <span class="op">=</span> <span class="ident">DateParseState</span>::<span class="ident">Date</span>;
- <span class="kw">for</span> <span class="ident">tok</span> <span class="kw">in</span> <span class="ident">date</span>.<span class="ident">split</span>(<span class="op">|</span><span class="ident">c</span><span class="op">|</span> <span class="ident">c</span> <span class="op">==</span> <span class="string">&#39; &#39;</span> <span class="op">||</span> <span class="ident">c</span> <span class="op">==</span> <span class="string">&#39;:&#39;</span>) {
- <span class="kw">if</span> <span class="ident">tok</span>.<span class="ident">is_empty</span>() {
- <span class="kw">continue</span>;
- }
- <span class="kw">match</span> <span class="ident">state</span> {
- <span class="ident">DateParseState</span>::<span class="ident">Date</span> <span class="op">=&gt;</span> {
- <span class="kw">match</span> <span class="ident">tok</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">u8</span><span class="op">&gt;</span>() {
- <span class="prelude-val">Ok</span>(<span class="ident">v</span>) <span class="op">=&gt;</span> {
- <span class="ident">day_of_month</span> <span class="op">=</span> <span class="ident">v</span>;
- <span class="ident">state</span> <span class="op">=</span> <span class="ident">DateParseState</span>::<span class="ident">Month</span>;
- }
- <span class="prelude-val">Err</span>(<span class="kw">_</span>) <span class="op">=&gt;</span> (),
- };
- <span class="kw">continue</span>;
- }
- <span class="ident">DateParseState</span>::<span class="ident">Month</span> <span class="op">=&gt;</span> {
- <span class="ident">month</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">tok</span>.<span class="ident">to_uppercase</span>().<span class="ident">as_str</span>() {
- <span class="string">&quot;JAN&quot;</span> <span class="op">|</span> <span class="string">&quot;JANUARY&quot;</span> <span class="op">=&gt;</span> <span class="number">0</span>,
- <span class="string">&quot;FEB&quot;</span> <span class="op">|</span> <span class="string">&quot;FEBRUARY&quot;</span> <span class="op">=&gt;</span> <span class="number">1</span>,
- <span class="string">&quot;MAR&quot;</span> <span class="op">|</span> <span class="string">&quot;MARCH&quot;</span> <span class="op">=&gt;</span> <span class="number">2</span>,
- <span class="string">&quot;APR&quot;</span> <span class="op">|</span> <span class="string">&quot;APRIL&quot;</span> <span class="op">=&gt;</span> <span class="number">3</span>,
- <span class="string">&quot;MAY&quot;</span> <span class="op">=&gt;</span> <span class="number">4</span>,
- <span class="string">&quot;JUN&quot;</span> <span class="op">|</span> <span class="string">&quot;JUNE&quot;</span> <span class="op">=&gt;</span> <span class="number">5</span>,
- <span class="string">&quot;JUL&quot;</span> <span class="op">|</span> <span class="string">&quot;JULY&quot;</span> <span class="op">=&gt;</span> <span class="number">6</span>,
- <span class="string">&quot;AUG&quot;</span> <span class="op">|</span> <span class="string">&quot;AUGUST&quot;</span> <span class="op">=&gt;</span> <span class="number">7</span>,
- <span class="string">&quot;SEP&quot;</span> <span class="op">|</span> <span class="string">&quot;SEPTEMBER&quot;</span> <span class="op">=&gt;</span> <span class="number">8</span>,
- <span class="string">&quot;OCT&quot;</span> <span class="op">|</span> <span class="string">&quot;OCTOBER&quot;</span> <span class="op">=&gt;</span> <span class="number">9</span>,
- <span class="string">&quot;NOV&quot;</span> <span class="op">|</span> <span class="string">&quot;NOVEMBER&quot;</span> <span class="op">=&gt;</span> <span class="number">10</span>,
- <span class="string">&quot;DEC&quot;</span> <span class="op">|</span> <span class="string">&quot;DECEMBER&quot;</span> <span class="op">=&gt;</span> <span class="number">11</span>,
- <span class="kw">_</span> <span class="op">=&gt;</span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="string">&quot;Unrecognized month&quot;</span>),
- };
- <span class="ident">state</span> <span class="op">=</span> <span class="ident">DateParseState</span>::<span class="ident">Year</span>;
- <span class="kw">continue</span>;
- }
- <span class="ident">DateParseState</span>::<span class="ident">Year</span> <span class="op">=&gt;</span> {
- <span class="kw">let</span> <span class="ident">year</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">tok</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">u32</span><span class="op">&gt;</span>() {
- <span class="prelude-val">Ok</span>(<span class="ident">v</span>) <span class="kw">if</span> <span class="ident">v</span> <span class="op">&lt;</span> <span class="number">70</span> <span class="op">=&gt;</span> <span class="number">2000</span> <span class="op">+</span> <span class="ident">v</span>,
- <span class="prelude-val">Ok</span>(<span class="ident">v</span>) <span class="kw">if</span> <span class="ident">v</span> <span class="op">&lt;</span> <span class="number">100</span> <span class="op">=&gt;</span> <span class="number">1900</span> <span class="op">+</span> <span class="ident">v</span>,
- <span class="prelude-val">Ok</span>(<span class="ident">v</span>) <span class="kw">if</span> <span class="ident">v</span> <span class="op">&lt;</span> <span class="number">1970</span> <span class="op">=&gt;</span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="string">&quot;Disallowed year&quot;</span>),
- <span class="prelude-val">Ok</span>(<span class="ident">v</span>) <span class="op">=&gt;</span> <span class="ident">v</span>,
- <span class="prelude-val">Err</span>(<span class="kw">_</span>) <span class="op">=&gt;</span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="string">&quot;Invalid year&quot;</span>),
- };
- <span class="ident">result</span> <span class="op">=</span> <span class="ident">seconds_to_date</span>(<span class="ident">year</span> <span class="kw">as</span> <span class="ident">i64</span>, <span class="ident">month</span> <span class="kw">as</span> <span class="ident">i64</span>, <span class="ident">day_of_month</span> <span class="kw">as</span> <span class="ident">i64</span>);
- <span class="ident">state</span> <span class="op">=</span> <span class="ident">DateParseState</span>::<span class="ident">Hour</span>;
- <span class="kw">continue</span>;
- }
- <span class="ident">DateParseState</span>::<span class="ident">Hour</span> <span class="op">=&gt;</span> {
- <span class="kw">let</span> <span class="ident">hour</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">tok</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">u8</span><span class="op">&gt;</span>() {
- <span class="prelude-val">Ok</span>(<span class="ident">v</span>) <span class="op">=&gt;</span> <span class="ident">v</span>,
- <span class="prelude-val">Err</span>(<span class="kw">_</span>) <span class="op">=&gt;</span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="string">&quot;Invalid hour&quot;</span>),
- };
- <span class="ident">result</span> <span class="op">+=</span> <span class="number">3600</span> <span class="op">*</span> (<span class="ident">hour</span> <span class="kw">as</span> <span class="ident">i64</span>);
- <span class="ident">state</span> <span class="op">=</span> <span class="ident">DateParseState</span>::<span class="ident">Minute</span>;
- <span class="kw">continue</span>;
- }
- <span class="ident">DateParseState</span>::<span class="ident">Minute</span> <span class="op">=&gt;</span> {
- <span class="kw">let</span> <span class="ident">minute</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">tok</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">u8</span><span class="op">&gt;</span>() {
- <span class="prelude-val">Ok</span>(<span class="ident">v</span>) <span class="op">=&gt;</span> <span class="ident">v</span>,
- <span class="prelude-val">Err</span>(<span class="kw">_</span>) <span class="op">=&gt;</span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="string">&quot;Invalid minute&quot;</span>),
- };
- <span class="ident">result</span> <span class="op">+=</span> <span class="number">60</span> <span class="op">*</span> (<span class="ident">minute</span> <span class="kw">as</span> <span class="ident">i64</span>);
- <span class="ident">state</span> <span class="op">=</span> <span class="ident">DateParseState</span>::<span class="ident">Second</span>;
- <span class="kw">continue</span>;
- }
- <span class="ident">DateParseState</span>::<span class="ident">Second</span> <span class="op">=&gt;</span> {
- <span class="kw">let</span> <span class="ident">second</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">tok</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">u8</span><span class="op">&gt;</span>() {
- <span class="prelude-val">Ok</span>(<span class="ident">v</span>) <span class="op">=&gt;</span> <span class="ident">v</span>,
- <span class="prelude-val">Err</span>(<span class="kw">_</span>) <span class="op">=&gt;</span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="string">&quot;Invalid second&quot;</span>),
- };
- <span class="ident">result</span> <span class="op">+=</span> <span class="ident">second</span> <span class="kw">as</span> <span class="ident">i64</span>;
- <span class="ident">state</span> <span class="op">=</span> <span class="ident">DateParseState</span>::<span class="ident">Timezone</span>;
- <span class="kw">continue</span>;
- }
- <span class="ident">DateParseState</span>::<span class="ident">Timezone</span> <span class="op">=&gt;</span> {
- <span class="kw">let</span> (<span class="ident">tz</span>, <span class="ident">tz_sign</span>) <span class="op">=</span> <span class="kw">match</span> <span class="ident">tok</span>.<span class="ident">parse</span>::<span class="op">&lt;</span><span class="ident">i32</span><span class="op">&gt;</span>() {
- <span class="prelude-val">Ok</span>(<span class="ident">v</span>) <span class="kw">if</span> <span class="ident">v</span> <span class="op">&lt;</span> <span class="number">0</span> <span class="op">=&gt;</span> (<span class="op">-</span><span class="ident">v</span>, <span class="op">-</span><span class="number">1</span>),
- <span class="prelude-val">Ok</span>(<span class="ident">v</span>) <span class="op">=&gt;</span> (<span class="ident">v</span>, <span class="number">1</span>),
- <span class="prelude-val">Err</span>(<span class="kw">_</span>) <span class="op">=&gt;</span> {
- <span class="kw">match</span> <span class="ident">tok</span>.<span class="ident">to_uppercase</span>().<span class="ident">as_str</span>() {
- <span class="comment">// This list taken from IETF RFC 822</span>
- <span class="string">&quot;UTC&quot;</span> <span class="op">|</span> <span class="string">&quot;UT&quot;</span> <span class="op">|</span> <span class="string">&quot;GMT&quot;</span> <span class="op">|</span> <span class="string">&quot;Z&quot;</span> <span class="op">=&gt;</span> (<span class="number">0</span>, <span class="number">1</span>),
- <span class="string">&quot;EDT&quot;</span> <span class="op">=&gt;</span> (<span class="number">400</span>, <span class="op">-</span><span class="number">1</span>),
- <span class="string">&quot;EST&quot;</span> <span class="op">|</span> <span class="string">&quot;CDT&quot;</span> <span class="op">=&gt;</span> (<span class="number">500</span>, <span class="op">-</span><span class="number">1</span>),
- <span class="string">&quot;CST&quot;</span> <span class="op">|</span> <span class="string">&quot;MDT&quot;</span> <span class="op">=&gt;</span> (<span class="number">600</span>, <span class="op">-</span><span class="number">1</span>),
- <span class="string">&quot;MST&quot;</span> <span class="op">|</span> <span class="string">&quot;PDT&quot;</span> <span class="op">=&gt;</span> (<span class="number">700</span>, <span class="op">-</span><span class="number">1</span>),
- <span class="string">&quot;PST&quot;</span> <span class="op">=&gt;</span> (<span class="number">800</span>, <span class="op">-</span><span class="number">1</span>),
- <span class="string">&quot;A&quot;</span> <span class="op">=&gt;</span> (<span class="number">100</span>, <span class="op">-</span><span class="number">1</span>),
- <span class="string">&quot;M&quot;</span> <span class="op">=&gt;</span> (<span class="number">1200</span>, <span class="op">-</span><span class="number">1</span>),
- <span class="string">&quot;N&quot;</span> <span class="op">=&gt;</span> (<span class="number">100</span>, <span class="number">1</span>),
- <span class="string">&quot;Y&quot;</span> <span class="op">=&gt;</span> (<span class="number">1200</span>, <span class="number">1</span>),
- <span class="kw">_</span> <span class="op">=&gt;</span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="string">&quot;Invalid timezone&quot;</span>),
- }
- }
- };
- <span class="kw">let</span> <span class="ident">tz_hours</span> <span class="op">=</span> <span class="ident">tz</span> <span class="op">/</span> <span class="number">100</span>;
- <span class="kw">let</span> <span class="ident">tz_mins</span> <span class="op">=</span> <span class="ident">tz</span> <span class="op">%</span> <span class="number">100</span>;
- <span class="kw">let</span> <span class="ident">tz_delta</span> <span class="op">=</span> (<span class="ident">tz_hours</span> <span class="op">*</span> <span class="number">3600</span>) <span class="op">+</span> (<span class="ident">tz_mins</span> <span class="op">*</span> <span class="number">60</span>);
- <span class="kw">if</span> <span class="ident">tz_sign</span> <span class="op">&lt;</span> <span class="number">0</span> {
- <span class="ident">result</span> <span class="op">+=</span> <span class="ident">tz_delta</span> <span class="kw">as</span> <span class="ident">i64</span>;
- } <span class="kw">else</span> {
- <span class="ident">result</span> <span class="op">-=</span> <span class="ident">tz_delta</span> <span class="kw">as</span> <span class="ident">i64</span>;
- }
- <span class="kw">break</span>;
- }
- }
- }
- <span class="prelude-val">Ok</span>(<span class="ident">result</span>)
-}
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
-<span class="kw">mod</span> <span class="ident">tests</span> {
- <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">parse_dates</span>() {
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dateparse</span>(<span class="string">&quot;Sun, 25 Sep 2016 18:36:33 -0400&quot;</span>).<span class="ident">unwrap</span>(),
- <span class="number">1474842993</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dateparse</span>(<span class="string">&quot;Fri, 01 Jan 2100 11:12:13 +0000&quot;</span>).<span class="ident">unwrap</span>(),
- <span class="number">4102485133</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dateparse</span>(<span class="string">&quot;Fri, 31 Dec 2100 00:00:00 +0000&quot;</span>).<span class="ident">unwrap</span>(),
- <span class="number">4133894400</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dateparse</span>(<span class="string">&quot;Fri, 31 Dec 2399 00:00:00 +0000&quot;</span>).<span class="ident">unwrap</span>(),
- <span class="number">13569379200</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dateparse</span>(<span class="string">&quot;Fri, 31 Dec 2400 00:00:00 +0000&quot;</span>).<span class="ident">unwrap</span>(),
- <span class="number">13601001600</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dateparse</span>(<span class="string">&quot;17 Sep 2016 16:05:38 -1000&quot;</span>).<span class="ident">unwrap</span>(), <span class="number">1474164338</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dateparse</span>(<span class="string">&quot;Fri, 30 Nov 2012 20:57:23 GMT&quot;</span>).<span class="ident">unwrap</span>(),
- <span class="number">1354309043</span>);
- }
-}
-</pre>
-</section>
- <section id='search' class="content hidden"></section>
-
- <section class="footer"></section>
-
- <aside id="help" class="hidden">
- <div>
- <h1 class="hidden">Help</h1>
-
- <div class="shortcuts">
- <h2>Keyboard Shortcuts</h2>
-
- <dl>
- <dt><kbd>?</kbd></dt>
- <dd>Show this help dialog</dd>
- <dt><kbd>S</kbd></dt>
- <dd>Focus the search field</dd>
- <dt><kbd>↑</kbd></dt>
- <dd>Move up in search results</dd>
- <dt><kbd>↓</kbd></dt>
- <dd>Move down in search results</dd>
- <dt><kbd>↹</kbd></dt>
- <dd>Switch tab</dd>
- <dt><kbd>&#9166;</kbd></dt>
- <dd>Go to active search result</dd>
- <dt><kbd>+</kbd></dt>
- <dd>Expand all sections</dd>
- <dt><kbd>-</kbd></dt>
- <dd>Collapse all sections</dd>
- </dl>
- </div>
-
- <div class="infos">
- <h2>Search Tricks</h2>
-
- <p>
- Prefix searches with a type followed by a colon (e.g.
- <code>fn:</code>) to restrict the search to a given type.
- </p>
-
- <p>
- Accepted types are: <code>fn</code>, <code>mod</code>,
- <code>struct</code>, <code>enum</code>,
- <code>trait</code>, <code>type</code>, <code>macro</code>,
- and <code>const</code>.
- </p>
-
- <p>
- Search functions by type signature (e.g.
- <code>vec -> usize</code> or <code>* -> vec</code>)
- </p>
- </div>
- </div>
- </aside>
-
-
-
- <script>
- window.rootPath = "../../";
- window.currentCrate = "mailparse";
- </script>
- <script src="../../main.js"></script>
- <script defer src="../../search-index.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/src/mailparse/lib.rs.html b/target/doc/src/mailparse/lib.rs.html
deleted file mode 100644
index e12cddf..0000000
--- a/target/doc/src/mailparse/lib.rs.html
+++ /dev/null
@@ -1,2576 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="generator" content="rustdoc">
- <meta name="description" content="Source to the Rust file `src/lib.rs`.">
- <meta name="keywords" content="rust, rustlang, rust-lang">
-
- <title>lib.rs.html -- source</title>
-
- <link rel="stylesheet" type="text/css" href="../../normalize.css">
- <link rel="stylesheet" type="text/css" href="../../rustdoc.css"
- id="mainThemeStyle">
-
- <link rel="stylesheet" type="text/css" href="../../dark.css">
- <link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle">
- <script src="../../storage.js"></script>
-
-
-
-
-</head>
-<body class="rustdoc source">
- <!--[if lte IE 8]>
- <div class="warning">
- This old browser is unsupported and will most likely display funky
- things.
- </div>
- <![endif]-->
-
-
-
- <nav class="sidebar">
- <div class="sidebar-menu">&#9776;</div>
-
-
- </nav>
-
- <div class="theme-picker">
- <button id="theme-picker" aria-label="Pick another theme!">
- <img src="../../brush.svg" width="18" alt="Pick another theme!">
- </button>
- <div id="theme-choices"></div>
- </div>
- <script src="../../theme.js"></script>
- <nav class="sub">
- <form class="search-form js-only">
- <div class="search-container">
- <input class="search-input" name="search"
- autocomplete="off"
- placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
- type="search">
- </div>
- </form>
- </nav>
-
- <section id='main' class="content"><pre class="line-numbers"><span id="1"> 1</span>
-<span id="2"> 2</span>
-<span id="3"> 3</span>
-<span id="4"> 4</span>
-<span id="5"> 5</span>
-<span id="6"> 6</span>
-<span id="7"> 7</span>
-<span id="8"> 8</span>
-<span id="9"> 9</span>
-<span id="10"> 10</span>
-<span id="11"> 11</span>
-<span id="12"> 12</span>
-<span id="13"> 13</span>
-<span id="14"> 14</span>
-<span id="15"> 15</span>
-<span id="16"> 16</span>
-<span id="17"> 17</span>
-<span id="18"> 18</span>
-<span id="19"> 19</span>
-<span id="20"> 20</span>
-<span id="21"> 21</span>
-<span id="22"> 22</span>
-<span id="23"> 23</span>
-<span id="24"> 24</span>
-<span id="25"> 25</span>
-<span id="26"> 26</span>
-<span id="27"> 27</span>
-<span id="28"> 28</span>
-<span id="29"> 29</span>
-<span id="30"> 30</span>
-<span id="31"> 31</span>
-<span id="32"> 32</span>
-<span id="33"> 33</span>
-<span id="34"> 34</span>
-<span id="35"> 35</span>
-<span id="36"> 36</span>
-<span id="37"> 37</span>
-<span id="38"> 38</span>
-<span id="39"> 39</span>
-<span id="40"> 40</span>
-<span id="41"> 41</span>
-<span id="42"> 42</span>
-<span id="43"> 43</span>
-<span id="44"> 44</span>
-<span id="45"> 45</span>
-<span id="46"> 46</span>
-<span id="47"> 47</span>
-<span id="48"> 48</span>
-<span id="49"> 49</span>
-<span id="50"> 50</span>
-<span id="51"> 51</span>
-<span id="52"> 52</span>
-<span id="53"> 53</span>
-<span id="54"> 54</span>
-<span id="55"> 55</span>
-<span id="56"> 56</span>
-<span id="57"> 57</span>
-<span id="58"> 58</span>
-<span id="59"> 59</span>
-<span id="60"> 60</span>
-<span id="61"> 61</span>
-<span id="62"> 62</span>
-<span id="63"> 63</span>
-<span id="64"> 64</span>
-<span id="65"> 65</span>
-<span id="66"> 66</span>
-<span id="67"> 67</span>
-<span id="68"> 68</span>
-<span id="69"> 69</span>
-<span id="70"> 70</span>
-<span id="71"> 71</span>
-<span id="72"> 72</span>
-<span id="73"> 73</span>
-<span id="74"> 74</span>
-<span id="75"> 75</span>
-<span id="76"> 76</span>
-<span id="77"> 77</span>
-<span id="78"> 78</span>
-<span id="79"> 79</span>
-<span id="80"> 80</span>
-<span id="81"> 81</span>
-<span id="82"> 82</span>
-<span id="83"> 83</span>
-<span id="84"> 84</span>
-<span id="85"> 85</span>
-<span id="86"> 86</span>
-<span id="87"> 87</span>
-<span id="88"> 88</span>
-<span id="89"> 89</span>
-<span id="90"> 90</span>
-<span id="91"> 91</span>
-<span id="92"> 92</span>
-<span id="93"> 93</span>
-<span id="94"> 94</span>
-<span id="95"> 95</span>
-<span id="96"> 96</span>
-<span id="97"> 97</span>
-<span id="98"> 98</span>
-<span id="99"> 99</span>
-<span id="100"> 100</span>
-<span id="101"> 101</span>
-<span id="102"> 102</span>
-<span id="103"> 103</span>
-<span id="104"> 104</span>
-<span id="105"> 105</span>
-<span id="106"> 106</span>
-<span id="107"> 107</span>
-<span id="108"> 108</span>
-<span id="109"> 109</span>
-<span id="110"> 110</span>
-<span id="111"> 111</span>
-<span id="112"> 112</span>
-<span id="113"> 113</span>
-<span id="114"> 114</span>
-<span id="115"> 115</span>
-<span id="116"> 116</span>
-<span id="117"> 117</span>
-<span id="118"> 118</span>
-<span id="119"> 119</span>
-<span id="120"> 120</span>
-<span id="121"> 121</span>
-<span id="122"> 122</span>
-<span id="123"> 123</span>
-<span id="124"> 124</span>
-<span id="125"> 125</span>
-<span id="126"> 126</span>
-<span id="127"> 127</span>
-<span id="128"> 128</span>
-<span id="129"> 129</span>
-<span id="130"> 130</span>
-<span id="131"> 131</span>
-<span id="132"> 132</span>
-<span id="133"> 133</span>
-<span id="134"> 134</span>
-<span id="135"> 135</span>
-<span id="136"> 136</span>
-<span id="137"> 137</span>
-<span id="138"> 138</span>
-<span id="139"> 139</span>
-<span id="140"> 140</span>
-<span id="141"> 141</span>
-<span id="142"> 142</span>
-<span id="143"> 143</span>
-<span id="144"> 144</span>
-<span id="145"> 145</span>
-<span id="146"> 146</span>
-<span id="147"> 147</span>
-<span id="148"> 148</span>
-<span id="149"> 149</span>
-<span id="150"> 150</span>
-<span id="151"> 151</span>
-<span id="152"> 152</span>
-<span id="153"> 153</span>
-<span id="154"> 154</span>
-<span id="155"> 155</span>
-<span id="156"> 156</span>
-<span id="157"> 157</span>
-<span id="158"> 158</span>
-<span id="159"> 159</span>
-<span id="160"> 160</span>
-<span id="161"> 161</span>
-<span id="162"> 162</span>
-<span id="163"> 163</span>
-<span id="164"> 164</span>
-<span id="165"> 165</span>
-<span id="166"> 166</span>
-<span id="167"> 167</span>
-<span id="168"> 168</span>
-<span id="169"> 169</span>
-<span id="170"> 170</span>
-<span id="171"> 171</span>
-<span id="172"> 172</span>
-<span id="173"> 173</span>
-<span id="174"> 174</span>
-<span id="175"> 175</span>
-<span id="176"> 176</span>
-<span id="177"> 177</span>
-<span id="178"> 178</span>
-<span id="179"> 179</span>
-<span id="180"> 180</span>
-<span id="181"> 181</span>
-<span id="182"> 182</span>
-<span id="183"> 183</span>
-<span id="184"> 184</span>
-<span id="185"> 185</span>
-<span id="186"> 186</span>
-<span id="187"> 187</span>
-<span id="188"> 188</span>
-<span id="189"> 189</span>
-<span id="190"> 190</span>
-<span id="191"> 191</span>
-<span id="192"> 192</span>
-<span id="193"> 193</span>
-<span id="194"> 194</span>
-<span id="195"> 195</span>
-<span id="196"> 196</span>
-<span id="197"> 197</span>
-<span id="198"> 198</span>
-<span id="199"> 199</span>
-<span id="200"> 200</span>
-<span id="201"> 201</span>
-<span id="202"> 202</span>
-<span id="203"> 203</span>
-<span id="204"> 204</span>
-<span id="205"> 205</span>
-<span id="206"> 206</span>
-<span id="207"> 207</span>
-<span id="208"> 208</span>
-<span id="209"> 209</span>
-<span id="210"> 210</span>
-<span id="211"> 211</span>
-<span id="212"> 212</span>
-<span id="213"> 213</span>
-<span id="214"> 214</span>
-<span id="215"> 215</span>
-<span id="216"> 216</span>
-<span id="217"> 217</span>
-<span id="218"> 218</span>
-<span id="219"> 219</span>
-<span id="220"> 220</span>
-<span id="221"> 221</span>
-<span id="222"> 222</span>
-<span id="223"> 223</span>
-<span id="224"> 224</span>
-<span id="225"> 225</span>
-<span id="226"> 226</span>
-<span id="227"> 227</span>
-<span id="228"> 228</span>
-<span id="229"> 229</span>
-<span id="230"> 230</span>
-<span id="231"> 231</span>
-<span id="232"> 232</span>
-<span id="233"> 233</span>
-<span id="234"> 234</span>
-<span id="235"> 235</span>
-<span id="236"> 236</span>
-<span id="237"> 237</span>
-<span id="238"> 238</span>
-<span id="239"> 239</span>
-<span id="240"> 240</span>
-<span id="241"> 241</span>
-<span id="242"> 242</span>
-<span id="243"> 243</span>
-<span id="244"> 244</span>
-<span id="245"> 245</span>
-<span id="246"> 246</span>
-<span id="247"> 247</span>
-<span id="248"> 248</span>
-<span id="249"> 249</span>
-<span id="250"> 250</span>
-<span id="251"> 251</span>
-<span id="252"> 252</span>
-<span id="253"> 253</span>
-<span id="254"> 254</span>
-<span id="255"> 255</span>
-<span id="256"> 256</span>
-<span id="257"> 257</span>
-<span id="258"> 258</span>
-<span id="259"> 259</span>
-<span id="260"> 260</span>
-<span id="261"> 261</span>
-<span id="262"> 262</span>
-<span id="263"> 263</span>
-<span id="264"> 264</span>
-<span id="265"> 265</span>
-<span id="266"> 266</span>
-<span id="267"> 267</span>
-<span id="268"> 268</span>
-<span id="269"> 269</span>
-<span id="270"> 270</span>
-<span id="271"> 271</span>
-<span id="272"> 272</span>
-<span id="273"> 273</span>
-<span id="274"> 274</span>
-<span id="275"> 275</span>
-<span id="276"> 276</span>
-<span id="277"> 277</span>
-<span id="278"> 278</span>
-<span id="279"> 279</span>
-<span id="280"> 280</span>
-<span id="281"> 281</span>
-<span id="282"> 282</span>
-<span id="283"> 283</span>
-<span id="284"> 284</span>
-<span id="285"> 285</span>
-<span id="286"> 286</span>
-<span id="287"> 287</span>
-<span id="288"> 288</span>
-<span id="289"> 289</span>
-<span id="290"> 290</span>
-<span id="291"> 291</span>
-<span id="292"> 292</span>
-<span id="293"> 293</span>
-<span id="294"> 294</span>
-<span id="295"> 295</span>
-<span id="296"> 296</span>
-<span id="297"> 297</span>
-<span id="298"> 298</span>
-<span id="299"> 299</span>
-<span id="300"> 300</span>
-<span id="301"> 301</span>
-<span id="302"> 302</span>
-<span id="303"> 303</span>
-<span id="304"> 304</span>
-<span id="305"> 305</span>
-<span id="306"> 306</span>
-<span id="307"> 307</span>
-<span id="308"> 308</span>
-<span id="309"> 309</span>
-<span id="310"> 310</span>
-<span id="311"> 311</span>
-<span id="312"> 312</span>
-<span id="313"> 313</span>
-<span id="314"> 314</span>
-<span id="315"> 315</span>
-<span id="316"> 316</span>
-<span id="317"> 317</span>
-<span id="318"> 318</span>
-<span id="319"> 319</span>
-<span id="320"> 320</span>
-<span id="321"> 321</span>
-<span id="322"> 322</span>
-<span id="323"> 323</span>
-<span id="324"> 324</span>
-<span id="325"> 325</span>
-<span id="326"> 326</span>
-<span id="327"> 327</span>
-<span id="328"> 328</span>
-<span id="329"> 329</span>
-<span id="330"> 330</span>
-<span id="331"> 331</span>
-<span id="332"> 332</span>
-<span id="333"> 333</span>
-<span id="334"> 334</span>
-<span id="335"> 335</span>
-<span id="336"> 336</span>
-<span id="337"> 337</span>
-<span id="338"> 338</span>
-<span id="339"> 339</span>
-<span id="340"> 340</span>
-<span id="341"> 341</span>
-<span id="342"> 342</span>
-<span id="343"> 343</span>
-<span id="344"> 344</span>
-<span id="345"> 345</span>
-<span id="346"> 346</span>
-<span id="347"> 347</span>
-<span id="348"> 348</span>
-<span id="349"> 349</span>
-<span id="350"> 350</span>
-<span id="351"> 351</span>
-<span id="352"> 352</span>
-<span id="353"> 353</span>
-<span id="354"> 354</span>
-<span id="355"> 355</span>
-<span id="356"> 356</span>
-<span id="357"> 357</span>
-<span id="358"> 358</span>
-<span id="359"> 359</span>
-<span id="360"> 360</span>
-<span id="361"> 361</span>
-<span id="362"> 362</span>
-<span id="363"> 363</span>
-<span id="364"> 364</span>
-<span id="365"> 365</span>
-<span id="366"> 366</span>
-<span id="367"> 367</span>
-<span id="368"> 368</span>
-<span id="369"> 369</span>
-<span id="370"> 370</span>
-<span id="371"> 371</span>
-<span id="372"> 372</span>
-<span id="373"> 373</span>
-<span id="374"> 374</span>
-<span id="375"> 375</span>
-<span id="376"> 376</span>
-<span id="377"> 377</span>
-<span id="378"> 378</span>
-<span id="379"> 379</span>
-<span id="380"> 380</span>
-<span id="381"> 381</span>
-<span id="382"> 382</span>
-<span id="383"> 383</span>
-<span id="384"> 384</span>
-<span id="385"> 385</span>
-<span id="386"> 386</span>
-<span id="387"> 387</span>
-<span id="388"> 388</span>
-<span id="389"> 389</span>
-<span id="390"> 390</span>
-<span id="391"> 391</span>
-<span id="392"> 392</span>
-<span id="393"> 393</span>
-<span id="394"> 394</span>
-<span id="395"> 395</span>
-<span id="396"> 396</span>
-<span id="397"> 397</span>
-<span id="398"> 398</span>
-<span id="399"> 399</span>
-<span id="400"> 400</span>
-<span id="401"> 401</span>
-<span id="402"> 402</span>
-<span id="403"> 403</span>
-<span id="404"> 404</span>
-<span id="405"> 405</span>
-<span id="406"> 406</span>
-<span id="407"> 407</span>
-<span id="408"> 408</span>
-<span id="409"> 409</span>
-<span id="410"> 410</span>
-<span id="411"> 411</span>
-<span id="412"> 412</span>
-<span id="413"> 413</span>
-<span id="414"> 414</span>
-<span id="415"> 415</span>
-<span id="416"> 416</span>
-<span id="417"> 417</span>
-<span id="418"> 418</span>
-<span id="419"> 419</span>
-<span id="420"> 420</span>
-<span id="421"> 421</span>
-<span id="422"> 422</span>
-<span id="423"> 423</span>
-<span id="424"> 424</span>
-<span id="425"> 425</span>
-<span id="426"> 426</span>
-<span id="427"> 427</span>
-<span id="428"> 428</span>
-<span id="429"> 429</span>
-<span id="430"> 430</span>
-<span id="431"> 431</span>
-<span id="432"> 432</span>
-<span id="433"> 433</span>
-<span id="434"> 434</span>
-<span id="435"> 435</span>
-<span id="436"> 436</span>
-<span id="437"> 437</span>
-<span id="438"> 438</span>
-<span id="439"> 439</span>
-<span id="440"> 440</span>
-<span id="441"> 441</span>
-<span id="442"> 442</span>
-<span id="443"> 443</span>
-<span id="444"> 444</span>
-<span id="445"> 445</span>
-<span id="446"> 446</span>
-<span id="447"> 447</span>
-<span id="448"> 448</span>
-<span id="449"> 449</span>
-<span id="450"> 450</span>
-<span id="451"> 451</span>
-<span id="452"> 452</span>
-<span id="453"> 453</span>
-<span id="454"> 454</span>
-<span id="455"> 455</span>
-<span id="456"> 456</span>
-<span id="457"> 457</span>
-<span id="458"> 458</span>
-<span id="459"> 459</span>
-<span id="460"> 460</span>
-<span id="461"> 461</span>
-<span id="462"> 462</span>
-<span id="463"> 463</span>
-<span id="464"> 464</span>
-<span id="465"> 465</span>
-<span id="466"> 466</span>
-<span id="467"> 467</span>
-<span id="468"> 468</span>
-<span id="469"> 469</span>
-<span id="470"> 470</span>
-<span id="471"> 471</span>
-<span id="472"> 472</span>
-<span id="473"> 473</span>
-<span id="474"> 474</span>
-<span id="475"> 475</span>
-<span id="476"> 476</span>
-<span id="477"> 477</span>
-<span id="478"> 478</span>
-<span id="479"> 479</span>
-<span id="480"> 480</span>
-<span id="481"> 481</span>
-<span id="482"> 482</span>
-<span id="483"> 483</span>
-<span id="484"> 484</span>
-<span id="485"> 485</span>
-<span id="486"> 486</span>
-<span id="487"> 487</span>
-<span id="488"> 488</span>
-<span id="489"> 489</span>
-<span id="490"> 490</span>
-<span id="491"> 491</span>
-<span id="492"> 492</span>
-<span id="493"> 493</span>
-<span id="494"> 494</span>
-<span id="495"> 495</span>
-<span id="496"> 496</span>
-<span id="497"> 497</span>
-<span id="498"> 498</span>
-<span id="499"> 499</span>
-<span id="500"> 500</span>
-<span id="501"> 501</span>
-<span id="502"> 502</span>
-<span id="503"> 503</span>
-<span id="504"> 504</span>
-<span id="505"> 505</span>
-<span id="506"> 506</span>
-<span id="507"> 507</span>
-<span id="508"> 508</span>
-<span id="509"> 509</span>
-<span id="510"> 510</span>
-<span id="511"> 511</span>
-<span id="512"> 512</span>
-<span id="513"> 513</span>
-<span id="514"> 514</span>
-<span id="515"> 515</span>
-<span id="516"> 516</span>
-<span id="517"> 517</span>
-<span id="518"> 518</span>
-<span id="519"> 519</span>
-<span id="520"> 520</span>
-<span id="521"> 521</span>
-<span id="522"> 522</span>
-<span id="523"> 523</span>
-<span id="524"> 524</span>
-<span id="525"> 525</span>
-<span id="526"> 526</span>
-<span id="527"> 527</span>
-<span id="528"> 528</span>
-<span id="529"> 529</span>
-<span id="530"> 530</span>
-<span id="531"> 531</span>
-<span id="532"> 532</span>
-<span id="533"> 533</span>
-<span id="534"> 534</span>
-<span id="535"> 535</span>
-<span id="536"> 536</span>
-<span id="537"> 537</span>
-<span id="538"> 538</span>
-<span id="539"> 539</span>
-<span id="540"> 540</span>
-<span id="541"> 541</span>
-<span id="542"> 542</span>
-<span id="543"> 543</span>
-<span id="544"> 544</span>
-<span id="545"> 545</span>
-<span id="546"> 546</span>
-<span id="547"> 547</span>
-<span id="548"> 548</span>
-<span id="549"> 549</span>
-<span id="550"> 550</span>
-<span id="551"> 551</span>
-<span id="552"> 552</span>
-<span id="553"> 553</span>
-<span id="554"> 554</span>
-<span id="555"> 555</span>
-<span id="556"> 556</span>
-<span id="557"> 557</span>
-<span id="558"> 558</span>
-<span id="559"> 559</span>
-<span id="560"> 560</span>
-<span id="561"> 561</span>
-<span id="562"> 562</span>
-<span id="563"> 563</span>
-<span id="564"> 564</span>
-<span id="565"> 565</span>
-<span id="566"> 566</span>
-<span id="567"> 567</span>
-<span id="568"> 568</span>
-<span id="569"> 569</span>
-<span id="570"> 570</span>
-<span id="571"> 571</span>
-<span id="572"> 572</span>
-<span id="573"> 573</span>
-<span id="574"> 574</span>
-<span id="575"> 575</span>
-<span id="576"> 576</span>
-<span id="577"> 577</span>
-<span id="578"> 578</span>
-<span id="579"> 579</span>
-<span id="580"> 580</span>
-<span id="581"> 581</span>
-<span id="582"> 582</span>
-<span id="583"> 583</span>
-<span id="584"> 584</span>
-<span id="585"> 585</span>
-<span id="586"> 586</span>
-<span id="587"> 587</span>
-<span id="588"> 588</span>
-<span id="589"> 589</span>
-<span id="590"> 590</span>
-<span id="591"> 591</span>
-<span id="592"> 592</span>
-<span id="593"> 593</span>
-<span id="594"> 594</span>
-<span id="595"> 595</span>
-<span id="596"> 596</span>
-<span id="597"> 597</span>
-<span id="598"> 598</span>
-<span id="599"> 599</span>
-<span id="600"> 600</span>
-<span id="601"> 601</span>
-<span id="602"> 602</span>
-<span id="603"> 603</span>
-<span id="604"> 604</span>
-<span id="605"> 605</span>
-<span id="606"> 606</span>
-<span id="607"> 607</span>
-<span id="608"> 608</span>
-<span id="609"> 609</span>
-<span id="610"> 610</span>
-<span id="611"> 611</span>
-<span id="612"> 612</span>
-<span id="613"> 613</span>
-<span id="614"> 614</span>
-<span id="615"> 615</span>
-<span id="616"> 616</span>
-<span id="617"> 617</span>
-<span id="618"> 618</span>
-<span id="619"> 619</span>
-<span id="620"> 620</span>
-<span id="621"> 621</span>
-<span id="622"> 622</span>
-<span id="623"> 623</span>
-<span id="624"> 624</span>
-<span id="625"> 625</span>
-<span id="626"> 626</span>
-<span id="627"> 627</span>
-<span id="628"> 628</span>
-<span id="629"> 629</span>
-<span id="630"> 630</span>
-<span id="631"> 631</span>
-<span id="632"> 632</span>
-<span id="633"> 633</span>
-<span id="634"> 634</span>
-<span id="635"> 635</span>
-<span id="636"> 636</span>
-<span id="637"> 637</span>
-<span id="638"> 638</span>
-<span id="639"> 639</span>
-<span id="640"> 640</span>
-<span id="641"> 641</span>
-<span id="642"> 642</span>
-<span id="643"> 643</span>
-<span id="644"> 644</span>
-<span id="645"> 645</span>
-<span id="646"> 646</span>
-<span id="647"> 647</span>
-<span id="648"> 648</span>
-<span id="649"> 649</span>
-<span id="650"> 650</span>
-<span id="651"> 651</span>
-<span id="652"> 652</span>
-<span id="653"> 653</span>
-<span id="654"> 654</span>
-<span id="655"> 655</span>
-<span id="656"> 656</span>
-<span id="657"> 657</span>
-<span id="658"> 658</span>
-<span id="659"> 659</span>
-<span id="660"> 660</span>
-<span id="661"> 661</span>
-<span id="662"> 662</span>
-<span id="663"> 663</span>
-<span id="664"> 664</span>
-<span id="665"> 665</span>
-<span id="666"> 666</span>
-<span id="667"> 667</span>
-<span id="668"> 668</span>
-<span id="669"> 669</span>
-<span id="670"> 670</span>
-<span id="671"> 671</span>
-<span id="672"> 672</span>
-<span id="673"> 673</span>
-<span id="674"> 674</span>
-<span id="675"> 675</span>
-<span id="676"> 676</span>
-<span id="677"> 677</span>
-<span id="678"> 678</span>
-<span id="679"> 679</span>
-<span id="680"> 680</span>
-<span id="681"> 681</span>
-<span id="682"> 682</span>
-<span id="683"> 683</span>
-<span id="684"> 684</span>
-<span id="685"> 685</span>
-<span id="686"> 686</span>
-<span id="687"> 687</span>
-<span id="688"> 688</span>
-<span id="689"> 689</span>
-<span id="690"> 690</span>
-<span id="691"> 691</span>
-<span id="692"> 692</span>
-<span id="693"> 693</span>
-<span id="694"> 694</span>
-<span id="695"> 695</span>
-<span id="696"> 696</span>
-<span id="697"> 697</span>
-<span id="698"> 698</span>
-<span id="699"> 699</span>
-<span id="700"> 700</span>
-<span id="701"> 701</span>
-<span id="702"> 702</span>
-<span id="703"> 703</span>
-<span id="704"> 704</span>
-<span id="705"> 705</span>
-<span id="706"> 706</span>
-<span id="707"> 707</span>
-<span id="708"> 708</span>
-<span id="709"> 709</span>
-<span id="710"> 710</span>
-<span id="711"> 711</span>
-<span id="712"> 712</span>
-<span id="713"> 713</span>
-<span id="714"> 714</span>
-<span id="715"> 715</span>
-<span id="716"> 716</span>
-<span id="717"> 717</span>
-<span id="718"> 718</span>
-<span id="719"> 719</span>
-<span id="720"> 720</span>
-<span id="721"> 721</span>
-<span id="722"> 722</span>
-<span id="723"> 723</span>
-<span id="724"> 724</span>
-<span id="725"> 725</span>
-<span id="726"> 726</span>
-<span id="727"> 727</span>
-<span id="728"> 728</span>
-<span id="729"> 729</span>
-<span id="730"> 730</span>
-<span id="731"> 731</span>
-<span id="732"> 732</span>
-<span id="733"> 733</span>
-<span id="734"> 734</span>
-<span id="735"> 735</span>
-<span id="736"> 736</span>
-<span id="737"> 737</span>
-<span id="738"> 738</span>
-<span id="739"> 739</span>
-<span id="740"> 740</span>
-<span id="741"> 741</span>
-<span id="742"> 742</span>
-<span id="743"> 743</span>
-<span id="744"> 744</span>
-<span id="745"> 745</span>
-<span id="746"> 746</span>
-<span id="747"> 747</span>
-<span id="748"> 748</span>
-<span id="749"> 749</span>
-<span id="750"> 750</span>
-<span id="751"> 751</span>
-<span id="752"> 752</span>
-<span id="753"> 753</span>
-<span id="754"> 754</span>
-<span id="755"> 755</span>
-<span id="756"> 756</span>
-<span id="757"> 757</span>
-<span id="758"> 758</span>
-<span id="759"> 759</span>
-<span id="760"> 760</span>
-<span id="761"> 761</span>
-<span id="762"> 762</span>
-<span id="763"> 763</span>
-<span id="764"> 764</span>
-<span id="765"> 765</span>
-<span id="766"> 766</span>
-<span id="767"> 767</span>
-<span id="768"> 768</span>
-<span id="769"> 769</span>
-<span id="770"> 770</span>
-<span id="771"> 771</span>
-<span id="772"> 772</span>
-<span id="773"> 773</span>
-<span id="774"> 774</span>
-<span id="775"> 775</span>
-<span id="776"> 776</span>
-<span id="777"> 777</span>
-<span id="778"> 778</span>
-<span id="779"> 779</span>
-<span id="780"> 780</span>
-<span id="781"> 781</span>
-<span id="782"> 782</span>
-<span id="783"> 783</span>
-<span id="784"> 784</span>
-<span id="785"> 785</span>
-<span id="786"> 786</span>
-<span id="787"> 787</span>
-<span id="788"> 788</span>
-<span id="789"> 789</span>
-<span id="790"> 790</span>
-<span id="791"> 791</span>
-<span id="792"> 792</span>
-<span id="793"> 793</span>
-<span id="794"> 794</span>
-<span id="795"> 795</span>
-<span id="796"> 796</span>
-<span id="797"> 797</span>
-<span id="798"> 798</span>
-<span id="799"> 799</span>
-<span id="800"> 800</span>
-<span id="801"> 801</span>
-<span id="802"> 802</span>
-<span id="803"> 803</span>
-<span id="804"> 804</span>
-<span id="805"> 805</span>
-<span id="806"> 806</span>
-<span id="807"> 807</span>
-<span id="808"> 808</span>
-<span id="809"> 809</span>
-<span id="810"> 810</span>
-<span id="811"> 811</span>
-<span id="812"> 812</span>
-<span id="813"> 813</span>
-<span id="814"> 814</span>
-<span id="815"> 815</span>
-<span id="816"> 816</span>
-<span id="817"> 817</span>
-<span id="818"> 818</span>
-<span id="819"> 819</span>
-<span id="820"> 820</span>
-<span id="821"> 821</span>
-<span id="822"> 822</span>
-<span id="823"> 823</span>
-<span id="824"> 824</span>
-<span id="825"> 825</span>
-<span id="826"> 826</span>
-<span id="827"> 827</span>
-<span id="828"> 828</span>
-<span id="829"> 829</span>
-<span id="830"> 830</span>
-<span id="831"> 831</span>
-<span id="832"> 832</span>
-<span id="833"> 833</span>
-<span id="834"> 834</span>
-<span id="835"> 835</span>
-<span id="836"> 836</span>
-<span id="837"> 837</span>
-<span id="838"> 838</span>
-<span id="839"> 839</span>
-<span id="840"> 840</span>
-<span id="841"> 841</span>
-<span id="842"> 842</span>
-<span id="843"> 843</span>
-<span id="844"> 844</span>
-<span id="845"> 845</span>
-<span id="846"> 846</span>
-<span id="847"> 847</span>
-<span id="848"> 848</span>
-<span id="849"> 849</span>
-<span id="850"> 850</span>
-<span id="851"> 851</span>
-<span id="852"> 852</span>
-<span id="853"> 853</span>
-<span id="854"> 854</span>
-<span id="855"> 855</span>
-<span id="856"> 856</span>
-<span id="857"> 857</span>
-<span id="858"> 858</span>
-<span id="859"> 859</span>
-<span id="860"> 860</span>
-<span id="861"> 861</span>
-<span id="862"> 862</span>
-<span id="863"> 863</span>
-<span id="864"> 864</span>
-<span id="865"> 865</span>
-<span id="866"> 866</span>
-<span id="867"> 867</span>
-<span id="868"> 868</span>
-<span id="869"> 869</span>
-<span id="870"> 870</span>
-<span id="871"> 871</span>
-<span id="872"> 872</span>
-<span id="873"> 873</span>
-<span id="874"> 874</span>
-<span id="875"> 875</span>
-<span id="876"> 876</span>
-<span id="877"> 877</span>
-<span id="878"> 878</span>
-<span id="879"> 879</span>
-<span id="880"> 880</span>
-<span id="881"> 881</span>
-<span id="882"> 882</span>
-<span id="883"> 883</span>
-<span id="884"> 884</span>
-<span id="885"> 885</span>
-<span id="886"> 886</span>
-<span id="887"> 887</span>
-<span id="888"> 888</span>
-<span id="889"> 889</span>
-<span id="890"> 890</span>
-<span id="891"> 891</span>
-<span id="892"> 892</span>
-<span id="893"> 893</span>
-<span id="894"> 894</span>
-<span id="895"> 895</span>
-<span id="896"> 896</span>
-<span id="897"> 897</span>
-<span id="898"> 898</span>
-<span id="899"> 899</span>
-<span id="900"> 900</span>
-<span id="901"> 901</span>
-<span id="902"> 902</span>
-<span id="903"> 903</span>
-<span id="904"> 904</span>
-<span id="905"> 905</span>
-<span id="906"> 906</span>
-<span id="907"> 907</span>
-<span id="908"> 908</span>
-<span id="909"> 909</span>
-<span id="910"> 910</span>
-<span id="911"> 911</span>
-<span id="912"> 912</span>
-<span id="913"> 913</span>
-<span id="914"> 914</span>
-<span id="915"> 915</span>
-<span id="916"> 916</span>
-<span id="917"> 917</span>
-<span id="918"> 918</span>
-<span id="919"> 919</span>
-<span id="920"> 920</span>
-<span id="921"> 921</span>
-<span id="922"> 922</span>
-<span id="923"> 923</span>
-<span id="924"> 924</span>
-<span id="925"> 925</span>
-<span id="926"> 926</span>
-<span id="927"> 927</span>
-<span id="928"> 928</span>
-<span id="929"> 929</span>
-<span id="930"> 930</span>
-<span id="931"> 931</span>
-<span id="932"> 932</span>
-<span id="933"> 933</span>
-<span id="934"> 934</span>
-<span id="935"> 935</span>
-<span id="936"> 936</span>
-<span id="937"> 937</span>
-<span id="938"> 938</span>
-<span id="939"> 939</span>
-<span id="940"> 940</span>
-<span id="941"> 941</span>
-<span id="942"> 942</span>
-<span id="943"> 943</span>
-<span id="944"> 944</span>
-<span id="945"> 945</span>
-<span id="946"> 946</span>
-<span id="947"> 947</span>
-<span id="948"> 948</span>
-<span id="949"> 949</span>
-<span id="950"> 950</span>
-<span id="951"> 951</span>
-<span id="952"> 952</span>
-<span id="953"> 953</span>
-<span id="954"> 954</span>
-<span id="955"> 955</span>
-<span id="956"> 956</span>
-<span id="957"> 957</span>
-<span id="958"> 958</span>
-<span id="959"> 959</span>
-<span id="960"> 960</span>
-<span id="961"> 961</span>
-<span id="962"> 962</span>
-<span id="963"> 963</span>
-<span id="964"> 964</span>
-<span id="965"> 965</span>
-<span id="966"> 966</span>
-<span id="967"> 967</span>
-<span id="968"> 968</span>
-<span id="969"> 969</span>
-<span id="970"> 970</span>
-<span id="971"> 971</span>
-<span id="972"> 972</span>
-<span id="973"> 973</span>
-<span id="974"> 974</span>
-<span id="975"> 975</span>
-<span id="976"> 976</span>
-<span id="977"> 977</span>
-<span id="978"> 978</span>
-<span id="979"> 979</span>
-<span id="980"> 980</span>
-<span id="981"> 981</span>
-<span id="982"> 982</span>
-<span id="983"> 983</span>
-<span id="984"> 984</span>
-<span id="985"> 985</span>
-<span id="986"> 986</span>
-<span id="987"> 987</span>
-<span id="988"> 988</span>
-<span id="989"> 989</span>
-<span id="990"> 990</span>
-<span id="991"> 991</span>
-<span id="992"> 992</span>
-<span id="993"> 993</span>
-<span id="994"> 994</span>
-<span id="995"> 995</span>
-<span id="996"> 996</span>
-<span id="997"> 997</span>
-<span id="998"> 998</span>
-<span id="999"> 999</span>
-<span id="1000">1000</span>
-<span id="1001">1001</span>
-<span id="1002">1002</span>
-<span id="1003">1003</span>
-<span id="1004">1004</span>
-<span id="1005">1005</span>
-<span id="1006">1006</span>
-<span id="1007">1007</span>
-<span id="1008">1008</span>
-<span id="1009">1009</span>
-<span id="1010">1010</span>
-<span id="1011">1011</span>
-<span id="1012">1012</span>
-<span id="1013">1013</span>
-<span id="1014">1014</span>
-<span id="1015">1015</span>
-<span id="1016">1016</span>
-<span id="1017">1017</span>
-<span id="1018">1018</span>
-<span id="1019">1019</span>
-<span id="1020">1020</span>
-<span id="1021">1021</span>
-<span id="1022">1022</span>
-<span id="1023">1023</span>
-<span id="1024">1024</span>
-<span id="1025">1025</span>
-<span id="1026">1026</span>
-<span id="1027">1027</span>
-<span id="1028">1028</span>
-<span id="1029">1029</span>
-<span id="1030">1030</span>
-<span id="1031">1031</span>
-<span id="1032">1032</span>
-<span id="1033">1033</span>
-<span id="1034">1034</span>
-<span id="1035">1035</span>
-<span id="1036">1036</span>
-<span id="1037">1037</span>
-<span id="1038">1038</span>
-<span id="1039">1039</span>
-<span id="1040">1040</span>
-<span id="1041">1041</span>
-<span id="1042">1042</span>
-<span id="1043">1043</span>
-<span id="1044">1044</span>
-<span id="1045">1045</span>
-<span id="1046">1046</span>
-<span id="1047">1047</span>
-<span id="1048">1048</span>
-<span id="1049">1049</span>
-<span id="1050">1050</span>
-<span id="1051">1051</span>
-<span id="1052">1052</span>
-<span id="1053">1053</span>
-<span id="1054">1054</span>
-<span id="1055">1055</span>
-<span id="1056">1056</span>
-<span id="1057">1057</span>
-<span id="1058">1058</span>
-<span id="1059">1059</span>
-<span id="1060">1060</span>
-<span id="1061">1061</span>
-<span id="1062">1062</span>
-<span id="1063">1063</span>
-<span id="1064">1064</span>
-<span id="1065">1065</span>
-<span id="1066">1066</span>
-<span id="1067">1067</span>
-<span id="1068">1068</span>
-<span id="1069">1069</span>
-<span id="1070">1070</span>
-<span id="1071">1071</span>
-<span id="1072">1072</span>
-<span id="1073">1073</span>
-<span id="1074">1074</span>
-<span id="1075">1075</span>
-<span id="1076">1076</span>
-<span id="1077">1077</span>
-<span id="1078">1078</span>
-<span id="1079">1079</span>
-<span id="1080">1080</span>
-<span id="1081">1081</span>
-<span id="1082">1082</span>
-<span id="1083">1083</span>
-<span id="1084">1084</span>
-<span id="1085">1085</span>
-<span id="1086">1086</span>
-<span id="1087">1087</span>
-<span id="1088">1088</span>
-<span id="1089">1089</span>
-<span id="1090">1090</span>
-<span id="1091">1091</span>
-<span id="1092">1092</span>
-<span id="1093">1093</span>
-<span id="1094">1094</span>
-<span id="1095">1095</span>
-<span id="1096">1096</span>
-<span id="1097">1097</span>
-<span id="1098">1098</span>
-<span id="1099">1099</span>
-<span id="1100">1100</span>
-<span id="1101">1101</span>
-<span id="1102">1102</span>
-<span id="1103">1103</span>
-<span id="1104">1104</span>
-<span id="1105">1105</span>
-<span id="1106">1106</span>
-<span id="1107">1107</span>
-<span id="1108">1108</span>
-<span id="1109">1109</span>
-<span id="1110">1110</span>
-<span id="1111">1111</span>
-<span id="1112">1112</span>
-<span id="1113">1113</span>
-<span id="1114">1114</span>
-<span id="1115">1115</span>
-<span id="1116">1116</span>
-<span id="1117">1117</span>
-<span id="1118">1118</span>
-<span id="1119">1119</span>
-<span id="1120">1120</span>
-<span id="1121">1121</span>
-<span id="1122">1122</span>
-<span id="1123">1123</span>
-<span id="1124">1124</span>
-<span id="1125">1125</span>
-<span id="1126">1126</span>
-<span id="1127">1127</span>
-<span id="1128">1128</span>
-<span id="1129">1129</span>
-<span id="1130">1130</span>
-<span id="1131">1131</span>
-<span id="1132">1132</span>
-<span id="1133">1133</span>
-<span id="1134">1134</span>
-<span id="1135">1135</span>
-<span id="1136">1136</span>
-<span id="1137">1137</span>
-<span id="1138">1138</span>
-<span id="1139">1139</span>
-<span id="1140">1140</span>
-<span id="1141">1141</span>
-<span id="1142">1142</span>
-<span id="1143">1143</span>
-<span id="1144">1144</span>
-<span id="1145">1145</span>
-<span id="1146">1146</span>
-<span id="1147">1147</span>
-<span id="1148">1148</span>
-<span id="1149">1149</span>
-<span id="1150">1150</span>
-<span id="1151">1151</span>
-<span id="1152">1152</span>
-<span id="1153">1153</span>
-<span id="1154">1154</span>
-<span id="1155">1155</span>
-<span id="1156">1156</span>
-<span id="1157">1157</span>
-<span id="1158">1158</span>
-<span id="1159">1159</span>
-<span id="1160">1160</span>
-<span id="1161">1161</span>
-<span id="1162">1162</span>
-<span id="1163">1163</span>
-<span id="1164">1164</span>
-<span id="1165">1165</span>
-<span id="1166">1166</span>
-<span id="1167">1167</span>
-<span id="1168">1168</span>
-<span id="1169">1169</span>
-<span id="1170">1170</span>
-<span id="1171">1171</span>
-<span id="1172">1172</span>
-<span id="1173">1173</span>
-<span id="1174">1174</span>
-<span id="1175">1175</span>
-<span id="1176">1176</span>
-<span id="1177">1177</span>
-<span id="1178">1178</span>
-<span id="1179">1179</span>
-<span id="1180">1180</span>
-<span id="1181">1181</span>
-<span id="1182">1182</span>
-<span id="1183">1183</span>
-<span id="1184">1184</span>
-<span id="1185">1185</span>
-<span id="1186">1186</span>
-<span id="1187">1187</span>
-<span id="1188">1188</span>
-<span id="1189">1189</span>
-<span id="1190">1190</span>
-<span id="1191">1191</span>
-<span id="1192">1192</span>
-<span id="1193">1193</span>
-<span id="1194">1194</span>
-<span id="1195">1195</span>
-<span id="1196">1196</span>
-<span id="1197">1197</span>
-<span id="1198">1198</span>
-<span id="1199">1199</span>
-<span id="1200">1200</span>
-<span id="1201">1201</span>
-<span id="1202">1202</span>
-<span id="1203">1203</span>
-<span id="1204">1204</span>
-<span id="1205">1205</span>
-<span id="1206">1206</span>
-<span id="1207">1207</span>
-<span id="1208">1208</span>
-<span id="1209">1209</span>
-<span id="1210">1210</span>
-<span id="1211">1211</span>
-<span id="1212">1212</span>
-<span id="1213">1213</span>
-<span id="1214">1214</span>
-<span id="1215">1215</span>
-<span id="1216">1216</span>
-<span id="1217">1217</span>
-<span id="1218">1218</span>
-<span id="1219">1219</span>
-<span id="1220">1220</span>
-<span id="1221">1221</span>
-<span id="1222">1222</span>
-<span id="1223">1223</span>
-<span id="1224">1224</span>
-<span id="1225">1225</span>
-<span id="1226">1226</span>
-</pre><pre class="rust ">
-<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">base64</span>;
-<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">encoding</span>;
-<span class="kw">extern</span> <span class="kw">crate</span> <span class="ident">quoted_printable</span>;
-
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">error</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">fmt</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">ops</span>::<span class="ident">Deref</span>;
-<span class="kw">use</span> <span class="ident">std</span>::<span class="ident">collections</span>::<span class="ident">BTreeMap</span>;
-
-<span class="kw">use</span> <span class="ident">encoding</span>::<span class="ident">Encoding</span>;
-
-<span class="attribute">#[<span class="ident">macro_use</span>]</span>
-<span class="kw">mod</span> <span class="ident">macros</span>;
-<span class="kw">mod</span> <span class="ident">dateparse</span>;
-
-<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">dateparse</span>::<span class="ident">dateparse</span>;
-
-<span class="doccomment">/// An error type that represents the different kinds of errors that may be</span>
-<span class="doccomment">/// encountered during message parsing.</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">MailParseError</span> {
- <span class="doccomment">/// Data that was specified as being in the quoted-printable transfer-encoding</span>
- <span class="doccomment">/// could not be successfully decoded as quoted-printable data.</span>
- <span class="ident">QuotedPrintableDecodeError</span>(<span class="ident">quoted_printable</span>::<span class="ident">QuotedPrintableError</span>),
- <span class="doccomment">/// Data that was specified as being in the base64 transfer-encoding could</span>
- <span class="doccomment">/// not be successfully decoded as base64 data.</span>
- <span class="ident">Base64DecodeError</span>(<span class="ident">base64</span>::<span class="ident">DecodeError</span>),
- <span class="doccomment">/// An error occurred when converting the raw byte data to Rust UTF-8 string</span>
- <span class="doccomment">/// format using the charset specified in the message.</span>
- <span class="ident">EncodingError</span>(<span class="ident">std</span>::<span class="ident">borrow</span>::<span class="ident">Cow</span><span class="op">&lt;</span><span class="lifetime">&#39;static</span>, <span class="ident">str</span><span class="op">&gt;</span>),
- <span class="doccomment">/// Some other error occurred while parsing the message; the description string</span>
- <span class="doccomment">/// provides additional details.</span>
- <span class="ident">Generic</span>(<span class="kw-2">&amp;</span><span class="lifetime">&#39;static</span> <span class="ident">str</span>),
-}
-
-<span class="kw">impl</span> <span class="ident">fmt</span>::<span class="ident">Display</span> <span class="kw">for</span> <span class="ident">MailParseError</span> {
- <span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&amp;</span><span class="kw-2">mut</span> <span class="ident">fmt</span>::<span class="ident">Formatter</span>) <span class="op">-&gt;</span> <span class="ident">fmt</span>::<span class="prelude-ty">Result</span> {
- <span class="kw">match</span> <span class="kw-2">*</span><span class="self">self</span> {
- <span class="ident">MailParseError</span>::<span class="ident">QuotedPrintableDecodeError</span>(<span class="kw-2">ref</span> <span class="ident">err</span>) <span class="op">=&gt;</span> {
- <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">&quot;QuotedPrintable decode error: {}&quot;</span>, <span class="ident">err</span>)
- }
- <span class="ident">MailParseError</span>::<span class="ident">Base64DecodeError</span>(<span class="kw-2">ref</span> <span class="ident">err</span>) <span class="op">=&gt;</span> <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">&quot;Base64 decode error: {}&quot;</span>, <span class="ident">err</span>),
- <span class="ident">MailParseError</span>::<span class="ident">EncodingError</span>(<span class="kw-2">ref</span> <span class="ident">err</span>) <span class="op">=&gt;</span> <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">&quot;Encoding error: {}&quot;</span>, <span class="ident">err</span>),
- <span class="ident">MailParseError</span>::<span class="ident">Generic</span>(<span class="kw-2">ref</span> <span class="ident">description</span>) <span class="op">=&gt;</span> <span class="macro">write</span><span class="macro">!</span>(<span class="ident">f</span>, <span class="string">&quot;{}&quot;</span>, <span class="ident">description</span>),
- }
- }
-}
-
-<span class="kw">impl</span> <span class="ident">error</span>::<span class="ident">Error</span> <span class="kw">for</span> <span class="ident">MailParseError</span> {
- <span class="kw">fn</span> <span class="ident">description</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-&gt;</span> <span class="kw-2">&amp;</span><span class="ident">str</span> {
- <span class="kw">match</span> <span class="kw-2">*</span><span class="self">self</span> {
- <span class="ident">MailParseError</span>::<span class="ident">QuotedPrintableDecodeError</span>(<span class="kw-2">ref</span> <span class="ident">err</span>) <span class="op">=&gt;</span> <span class="ident">err</span>.<span class="ident">description</span>(),
- <span class="ident">MailParseError</span>::<span class="ident">Base64DecodeError</span>(<span class="kw-2">ref</span> <span class="ident">err</span>) <span class="op">=&gt;</span> <span class="ident">err</span>.<span class="ident">description</span>(),
- <span class="ident">MailParseError</span>::<span class="ident">EncodingError</span>(<span class="kw-2">ref</span> <span class="ident">err</span>) <span class="op">=&gt;</span> <span class="ident">err</span>.<span class="ident">deref</span>(),
- <span class="kw">_</span> <span class="op">=&gt;</span> <span class="string">&quot;An error occurred while attempting to parse the input&quot;</span>,
- }
- }
-
- <span class="kw">fn</span> <span class="ident">cause</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="kw-2">&amp;</span><span class="ident">error</span>::<span class="ident">Error</span><span class="op">&gt;</span> {
- <span class="kw">match</span> <span class="kw-2">*</span><span class="self">self</span> {
- <span class="ident">MailParseError</span>::<span class="ident">QuotedPrintableDecodeError</span>(<span class="kw-2">ref</span> <span class="ident">err</span>) <span class="op">=&gt;</span> <span class="prelude-val">Some</span>(<span class="ident">err</span>),
- <span class="ident">MailParseError</span>::<span class="ident">Base64DecodeError</span>(<span class="kw-2">ref</span> <span class="ident">err</span>) <span class="op">=&gt;</span> <span class="prelude-val">Some</span>(<span class="ident">err</span>),
- <span class="kw">_</span> <span class="op">=&gt;</span> <span class="prelude-val">None</span>,
- }
- }
-}
-
-<span class="kw">impl</span> <span class="ident">From</span><span class="op">&lt;</span><span class="ident">quoted_printable</span>::<span class="ident">QuotedPrintableError</span><span class="op">&gt;</span> <span class="kw">for</span> <span class="ident">MailParseError</span> {
- <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">err</span>: <span class="ident">quoted_printable</span>::<span class="ident">QuotedPrintableError</span>) <span class="op">-&gt;</span> <span class="ident">MailParseError</span> {
- <span class="ident">MailParseError</span>::<span class="ident">QuotedPrintableDecodeError</span>(<span class="ident">err</span>)
- }
-}
-
-<span class="kw">impl</span> <span class="ident">From</span><span class="op">&lt;</span><span class="ident">base64</span>::<span class="ident">DecodeError</span><span class="op">&gt;</span> <span class="kw">for</span> <span class="ident">MailParseError</span> {
- <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">err</span>: <span class="ident">base64</span>::<span class="ident">DecodeError</span>) <span class="op">-&gt;</span> <span class="ident">MailParseError</span> {
- <span class="ident">MailParseError</span>::<span class="ident">Base64DecodeError</span>(<span class="ident">err</span>)
- }
-}
-
-<span class="kw">impl</span> <span class="ident">From</span><span class="op">&lt;</span><span class="ident">std</span>::<span class="ident">borrow</span>::<span class="ident">Cow</span><span class="op">&lt;</span><span class="lifetime">&#39;static</span>, <span class="ident">str</span><span class="op">&gt;&gt;</span> <span class="kw">for</span> <span class="ident">MailParseError</span> {
- <span class="kw">fn</span> <span class="ident">from</span>(<span class="ident">err</span>: <span class="ident">std</span>::<span class="ident">borrow</span>::<span class="ident">Cow</span><span class="op">&lt;</span><span class="lifetime">&#39;static</span>, <span class="ident">str</span><span class="op">&gt;</span>) <span class="op">-&gt;</span> <span class="ident">MailParseError</span> {
- <span class="ident">MailParseError</span>::<span class="ident">EncodingError</span>(<span class="ident">err</span>)
- }
-}
-
-<span class="doccomment">/// A struct that represents a single header in the message.</span>
-<span class="doccomment">/// It holds slices into the raw byte array passed to parse_mail, and so the</span>
-<span class="doccomment">/// lifetime of this struct must be contained within the lifetime of the raw</span>
-<span class="doccomment">/// input. There are additional accessor functions on this struct to extract</span>
-<span class="doccomment">/// the data as Rust strings.</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">MailHeader</span><span class="op">&lt;</span><span class="lifetime">&#39;a</span><span class="op">&gt;</span> {
- <span class="ident">key</span>: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a</span> [<span class="ident">u8</span>],
- <span class="ident">value</span>: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a</span> [<span class="ident">u8</span>],
-}
-
-<span class="kw">fn</span> <span class="ident">is_boundary</span>(<span class="ident">line</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>, <span class="ident">ix</span>: <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span>) <span class="op">-&gt;</span> <span class="ident">bool</span> {
- <span class="kw">match</span> <span class="ident">ix</span> {
- <span class="prelude-val">None</span> <span class="op">=&gt;</span> <span class="bool-val">true</span>,
- <span class="prelude-val">Some</span>(<span class="ident">v</span>) <span class="op">=&gt;</span> {
- <span class="kw">if</span> <span class="ident">v</span> <span class="op">&gt;=</span> <span class="ident">line</span>.<span class="ident">len</span>() {
- <span class="kw">return</span> <span class="bool-val">true</span>;
- }
- <span class="kw">let</span> <span class="ident">c</span> <span class="op">=</span> <span class="ident">line</span>.<span class="ident">chars</span>().<span class="ident">nth</span>(<span class="ident">v</span>).<span class="ident">unwrap</span>();
- <span class="kw">return</span> <span class="ident">c</span>.<span class="ident">is_whitespace</span>() <span class="op">||</span> <span class="ident">c</span> <span class="op">==</span> <span class="string">&#39;&quot;&#39;</span> <span class="op">||</span> <span class="ident">c</span> <span class="op">==</span> <span class="string">&#39;(&#39;</span> <span class="op">||</span> <span class="ident">c</span> <span class="op">==</span> <span class="string">&#39;)&#39;</span> <span class="op">||</span> <span class="ident">c</span> <span class="op">==</span> <span class="string">&#39;&lt;&#39;</span> <span class="op">||</span> <span class="ident">c</span> <span class="op">==</span> <span class="string">&#39;&gt;&#39;</span>;
- }
- }
-}
-
-<span class="kw">fn</span> <span class="ident">find_from</span>(<span class="ident">line</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>, <span class="ident">ix_start</span>: <span class="ident">usize</span>, <span class="ident">key</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span> {
- <span class="ident">line</span>[<span class="ident">ix_start</span>..].<span class="ident">find</span>(<span class="ident">key</span>).<span class="ident">map</span>(<span class="op">|</span><span class="ident">v</span><span class="op">|</span> <span class="ident">ix_start</span> <span class="op">+</span> <span class="ident">v</span>)
-}
-
-<span class="kw">fn</span> <span class="ident">find_from_u8</span>(<span class="ident">line</span>: <span class="kw-2">&amp;</span>[<span class="ident">u8</span>], <span class="ident">ix_start</span>: <span class="ident">usize</span>, <span class="ident">key</span>: <span class="kw-2">&amp;</span>[<span class="ident">u8</span>]) <span class="op">-&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">usize</span><span class="op">&gt;</span> {
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">key</span>.<span class="ident">len</span>() <span class="op">&gt;</span> <span class="number">0</span>);
- <span class="macro">assert</span><span class="macro">!</span>(<span class="ident">ix_start</span> <span class="op">&lt;</span> <span class="ident">line</span>.<span class="ident">len</span>());
- <span class="kw">let</span> <span class="ident">ix_end</span> <span class="op">=</span> <span class="ident">line</span>.<span class="ident">len</span>() <span class="op">-</span> <span class="ident">key</span>.<span class="ident">len</span>();
- <span class="kw">if</span> <span class="ident">ix_start</span> <span class="op">&lt;=</span> <span class="ident">ix_end</span> {
- <span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="ident">ix_start</span>..<span class="ident">ix_end</span> {
- <span class="kw">if</span> <span class="ident">line</span>[<span class="ident">i</span>] <span class="op">==</span> <span class="ident">key</span>[<span class="number">0</span>] {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">success</span> <span class="op">=</span> <span class="bool-val">true</span>;
- <span class="kw">for</span> <span class="ident">j</span> <span class="kw">in</span> <span class="number">1</span>..<span class="ident">key</span>.<span class="ident">len</span>() {
- <span class="kw">if</span> <span class="ident">line</span>[<span class="ident">i</span> <span class="op">+</span> <span class="ident">j</span>] <span class="op">!=</span> <span class="ident">key</span>[<span class="ident">j</span>] {
- <span class="ident">success</span> <span class="op">=</span> <span class="bool-val">false</span>;
- <span class="kw">break</span>;
- }
- }
- <span class="kw">if</span> <span class="ident">success</span> {
- <span class="kw">return</span> <span class="prelude-val">Some</span>(<span class="ident">i</span>);
- }
- }
- }
- }
- <span class="prelude-val">None</span>
-}
-
-<span class="attribute">#[<span class="ident">test</span>]</span>
-<span class="kw">fn</span> <span class="ident">test_find_from_u8</span>() {
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">find_from_u8</span>(<span class="string">b&quot;hello world&quot;</span>, <span class="number">0</span>, <span class="string">b&quot;hell&quot;</span>), <span class="prelude-val">Some</span>(<span class="number">0</span>));
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">find_from_u8</span>(<span class="string">b&quot;hello world&quot;</span>, <span class="number">0</span>, <span class="string">b&quot;o&quot;</span>), <span class="prelude-val">Some</span>(<span class="number">4</span>));
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">find_from_u8</span>(<span class="string">b&quot;hello world&quot;</span>, <span class="number">4</span>, <span class="string">b&quot;o&quot;</span>), <span class="prelude-val">Some</span>(<span class="number">4</span>));
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">find_from_u8</span>(<span class="string">b&quot;hello world&quot;</span>, <span class="number">5</span>, <span class="string">b&quot;o&quot;</span>), <span class="prelude-val">Some</span>(<span class="number">7</span>));
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">find_from_u8</span>(<span class="string">b&quot;hello world&quot;</span>, <span class="number">8</span>, <span class="string">b&quot;o&quot;</span>), <span class="prelude-val">None</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">find_from_u8</span>(<span class="string">b&quot;hello world&quot;</span>, <span class="number">10</span>, <span class="string">b&quot;d&quot;</span>), <span class="prelude-val">None</span>);
-}
-
-<span class="kw">impl</span><span class="op">&lt;</span><span class="lifetime">&#39;a</span><span class="op">&gt;</span> <span class="ident">MailHeader</span><span class="op">&lt;</span><span class="lifetime">&#39;a</span><span class="op">&gt;</span> {
- <span class="doccomment">/// Get the name of the header. Note that header names are case-insensitive.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_key</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">String</span>, <span class="ident">MailParseError</span><span class="op">&gt;</span> {
- <span class="prelude-val">Ok</span>(
- <span class="macro">try</span><span class="macro">!</span>(<span class="ident">encoding</span>::<span class="ident">all</span>::<span class="ident">ISO_8859_1</span>.<span class="ident">decode</span>(
- <span class="self">self</span>.<span class="ident">key</span>,
- <span class="ident">encoding</span>::<span class="ident">DecoderTrap</span>::<span class="ident">Strict</span>,
- )).<span class="ident">trim</span>()
- .<span class="ident">to_string</span>(),
- )
- }
-
- <span class="kw">fn</span> <span class="ident">decode_word</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">encoded</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span> {
- <span class="kw">let</span> <span class="ident">ix_delim1</span> <span class="op">=</span> <span class="macro">try_none</span><span class="macro">!</span>(<span class="ident">encoded</span>.<span class="ident">find</span>(<span class="string">&quot;?&quot;</span>));
- <span class="kw">let</span> <span class="ident">ix_delim2</span> <span class="op">=</span> <span class="macro">try_none</span><span class="macro">!</span>(<span class="ident">find_from</span>(<span class="ident">encoded</span>, <span class="ident">ix_delim1</span> <span class="op">+</span> <span class="number">1</span>, <span class="string">&quot;?&quot;</span>));
-
- <span class="kw">let</span> <span class="ident">charset</span> <span class="op">=</span> <span class="kw-2">&amp;</span><span class="ident">encoded</span>[<span class="number">0</span>..<span class="ident">ix_delim1</span>];
- <span class="kw">let</span> <span class="ident">transfer_coding</span> <span class="op">=</span> <span class="kw-2">&amp;</span><span class="ident">encoded</span>[<span class="ident">ix_delim1</span> <span class="op">+</span> <span class="number">1</span>..<span class="ident">ix_delim2</span>];
- <span class="kw">let</span> <span class="ident">input</span> <span class="op">=</span> <span class="kw-2">&amp;</span><span class="ident">encoded</span>[<span class="ident">ix_delim2</span> <span class="op">+</span> <span class="number">1</span>..];
-
- <span class="kw">let</span> <span class="ident">decoded</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">transfer_coding</span> {
- <span class="string">&quot;B&quot;</span> <span class="op">|</span> <span class="string">&quot;b&quot;</span> <span class="op">=&gt;</span> <span class="macro">try_none</span><span class="macro">!</span>(<span class="ident">base64</span>::<span class="ident">decode</span>(<span class="ident">input</span>.<span class="ident">as_bytes</span>()).<span class="ident">ok</span>()),
- <span class="string">&quot;Q&quot;</span> <span class="op">|</span> <span class="string">&quot;q&quot;</span> <span class="op">=&gt;</span> {
- <span class="comment">// The quoted_printable module does a trim_right on the input, so if</span>
- <span class="comment">// that affects the output we should save and restore the trailing</span>
- <span class="comment">// whitespace</span>
- <span class="kw">let</span> <span class="ident">to_decode</span> <span class="op">=</span> <span class="ident">input</span>.<span class="ident">replace</span>(<span class="string">&quot;_&quot;</span>, <span class="string">&quot; &quot;</span>);
- <span class="kw">let</span> <span class="ident">trimmed</span> <span class="op">=</span> <span class="ident">to_decode</span>.<span class="ident">trim_right</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">d</span> <span class="op">=</span>
- <span class="ident">quoted_printable</span>::<span class="ident">decode</span>(<span class="kw-2">&amp;</span><span class="ident">trimmed</span>, <span class="ident">quoted_printable</span>::<span class="ident">ParseMode</span>::<span class="ident">Robust</span>);
- <span class="kw">if</span> <span class="ident">d</span>.<span class="ident">is_ok</span>() <span class="op">&amp;&amp;</span> <span class="ident">to_decode</span>.<span class="ident">len</span>() <span class="op">!=</span> <span class="ident">trimmed</span>.<span class="ident">len</span>() {
- <span class="ident">d</span>.<span class="ident">as_mut</span>().<span class="ident">unwrap</span>().<span class="ident">extend_from_slice</span>(
- <span class="ident">to_decode</span>[<span class="ident">trimmed</span>.<span class="ident">len</span>()..].<span class="ident">as_bytes</span>(),
- );
- }
- <span class="macro">try_none</span><span class="macro">!</span>(<span class="ident">d</span>.<span class="ident">ok</span>())
- }
- <span class="kw">_</span> <span class="op">=&gt;</span> <span class="kw">return</span> <span class="prelude-val">None</span>,
- };
- <span class="kw">let</span> <span class="ident">charset_conv</span> <span class="op">=</span> <span class="macro">try_none</span><span class="macro">!</span>(<span class="ident">encoding</span>::<span class="ident">label</span>::<span class="ident">encoding_from_whatwg_label</span>(<span class="ident">charset</span>));
- <span class="ident">charset_conv</span>
- .<span class="ident">decode</span>(<span class="kw-2">&amp;</span><span class="ident">decoded</span>, <span class="ident">encoding</span>::<span class="ident">DecoderTrap</span>::<span class="ident">Replace</span>)
- .<span class="ident">ok</span>()
- }
-
- <span class="doccomment">/// Get the value of the header. Any sequences of newlines characters followed</span>
- <span class="doccomment">/// by whitespace are collapsed into a single space. In effect, header values</span>
- <span class="doccomment">/// wrapped across multiple lines are compacted back into one line, while</span>
- <span class="doccomment">/// discarding the extra whitespace required by the MIME format. Additionally,</span>
- <span class="doccomment">/// any quoted-printable words in the value are decoded.</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// # Examples</span>
- <span class="doccomment">/// ```</span>
- <span class="doccomment">/// use mailparse::parse_header;</span>
- <span class="doccomment">/// let (parsed, _) = parse_header(b&quot;Subject: =?iso-8859-1?Q?=A1Hola,_se=F1or!?=&quot;).unwrap();</span>
- <span class="doccomment">/// assert_eq!(parsed.get_key().unwrap(), &quot;Subject&quot;);</span>
- <span class="doccomment">/// assert_eq!(parsed.get_value().unwrap(), &quot;\u{a1}Hola, se\u{f1}or!&quot;);</span>
- <span class="doccomment">/// ```</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_value</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">String</span>, <span class="ident">MailParseError</span><span class="op">&gt;</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">String</span>::<span class="ident">new</span>();
- <span class="kw">let</span> <span class="ident">chars</span> <span class="op">=</span> <span class="macro">try</span><span class="macro">!</span>(<span class="ident">encoding</span>::<span class="ident">all</span>::<span class="ident">ISO_8859_1</span>.<span class="ident">decode</span>(
- <span class="self">self</span>.<span class="ident">value</span>,
- <span class="ident">encoding</span>::<span class="ident">DecoderTrap</span>::<span class="ident">Strict</span>,
- ));
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">lines</span> <span class="op">=</span> <span class="ident">chars</span>.<span class="ident">lines</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">add_space</span> <span class="op">=</span> <span class="bool-val">false</span>;
- <span class="kw">loop</span> {
- <span class="kw">let</span> <span class="ident">line</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">lines</span>.<span class="ident">next</span>() {
- <span class="prelude-val">Some</span>(<span class="ident">v</span>) <span class="op">=&gt;</span> <span class="ident">v</span>.<span class="ident">trim_left</span>(),
- <span class="prelude-val">None</span> <span class="op">=&gt;</span> <span class="kw">break</span>,
- };
-
- <span class="kw">if</span> <span class="ident">add_space</span> {
- <span class="ident">result</span>.<span class="ident">push</span>(<span class="string">&#39; &#39;</span>);
- }
- <span class="ident">add_space</span> <span class="op">=</span> <span class="bool-val">true</span>;
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">ix_search</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="kw">loop</span> {
- <span class="kw">match</span> <span class="ident">find_from</span>(<span class="ident">line</span>, <span class="ident">ix_search</span>, <span class="string">&quot;=?&quot;</span>) {
- <span class="prelude-val">Some</span>(<span class="ident">v</span>) <span class="op">=&gt;</span> {
- <span class="kw">let</span> <span class="ident">ix_begin</span> <span class="op">=</span> <span class="ident">v</span> <span class="op">+</span> <span class="number">2</span>;
- <span class="kw">if</span> <span class="op">!</span><span class="ident">is_boundary</span>(<span class="ident">line</span>, <span class="ident">ix_begin</span>.<span class="ident">checked_sub</span>(<span class="number">3</span>)) {
- <span class="ident">result</span>.<span class="ident">push_str</span>(<span class="kw-2">&amp;</span><span class="ident">line</span>[<span class="ident">ix_search</span>..<span class="ident">ix_begin</span>]);
- <span class="ident">ix_search</span> <span class="op">=</span> <span class="ident">ix_begin</span>;
- <span class="kw">continue</span>;
- }
- <span class="ident">result</span>.<span class="ident">push_str</span>(<span class="kw-2">&amp;</span><span class="ident">line</span>[<span class="ident">ix_search</span>..<span class="ident">ix_begin</span> <span class="op">-</span> <span class="number">2</span>]);
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">ix_end_search</span> <span class="op">=</span> <span class="ident">ix_begin</span>;
- <span class="kw">loop</span> {
- <span class="kw">match</span> <span class="ident">find_from</span>(<span class="ident">line</span>, <span class="ident">ix_end_search</span>, <span class="string">&quot;?=&quot;</span>) {
- <span class="prelude-val">Some</span>(<span class="ident">ix_end</span>) <span class="op">=&gt;</span> {
- <span class="kw">if</span> <span class="op">!</span><span class="ident">is_boundary</span>(<span class="ident">line</span>, <span class="ident">ix_end</span>.<span class="ident">checked_add</span>(<span class="number">2</span>)) {
- <span class="ident">ix_end_search</span> <span class="op">=</span> <span class="ident">ix_end</span> <span class="op">+</span> <span class="number">2</span>;
- <span class="kw">continue</span>;
- }
- <span class="kw">match</span> <span class="self">self</span>.<span class="ident">decode_word</span>(<span class="kw-2">&amp;</span><span class="ident">line</span>[<span class="ident">ix_begin</span>..<span class="ident">ix_end</span>]) {
- <span class="prelude-val">Some</span>(<span class="ident">v</span>) <span class="op">=&gt;</span> {
- <span class="ident">result</span>.<span class="ident">push_str</span>(<span class="kw-2">&amp;</span><span class="ident">v</span>);
- <span class="ident">add_space</span> <span class="op">=</span> <span class="bool-val">false</span>;
- }
- <span class="prelude-val">None</span> <span class="op">=&gt;</span> <span class="ident">result</span>.<span class="ident">push_str</span>(<span class="kw-2">&amp;</span><span class="ident">line</span>[<span class="ident">ix_begin</span> <span class="op">-</span> <span class="number">2</span>..<span class="ident">ix_end</span> <span class="op">+</span> <span class="number">2</span>]),
- };
- <span class="ident">ix_search</span> <span class="op">=</span> <span class="ident">ix_end</span>;
- }
- <span class="prelude-val">None</span> <span class="op">=&gt;</span> {
- <span class="ident">result</span>.<span class="ident">push_str</span>(<span class="kw-2">&amp;</span><span class="string">&quot;=?&quot;</span>);
- }
- };
- <span class="kw">break</span>;
- }
- <span class="ident">ix_search</span> <span class="op">=</span> <span class="ident">ix_search</span> <span class="op">+</span> <span class="number">2</span>;
- <span class="kw">continue</span>;
- }
- <span class="prelude-val">None</span> <span class="op">=&gt;</span> {
- <span class="ident">result</span>.<span class="ident">push_str</span>(<span class="kw-2">&amp;</span><span class="ident">line</span>[<span class="ident">ix_search</span>..]);
- <span class="kw">break</span>;
- }
- };
- }
- }
- <span class="prelude-val">Ok</span>(<span class="ident">result</span>)
- }
-}
-
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">enum</span> <span class="ident">HeaderParseState</span> {
- <span class="ident">Initial</span>,
- <span class="ident">Key</span>,
- <span class="ident">PreValue</span>,
- <span class="ident">Value</span>,
- <span class="ident">ValueNewline</span>,
-}
-
-<span class="doccomment">/// Parse a single header from the raw data given.</span>
-<span class="doccomment">/// This function takes raw byte data, and starts parsing it, expecting there</span>
-<span class="doccomment">/// to be a MIME header key-value pair right at the beginning. It parses that</span>
-<span class="doccomment">/// header and returns it, along with the index at which the next header is</span>
-<span class="doccomment">/// expected to start. If you just want to parse a single header, you can ignore</span>
-<span class="doccomment">/// the second component of the tuple, which is the index of the next header.</span>
-<span class="doccomment">/// Error values are returned if the data could not be successfully interpreted</span>
-<span class="doccomment">/// as a MIME key-value pair.</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// # Examples</span>
-<span class="doccomment">/// ```</span>
-<span class="doccomment">/// use mailparse::parse_header;</span>
-<span class="doccomment">/// let (parsed, _) = parse_header(concat!(</span>
-<span class="doccomment">/// &quot;Subject: Hello, sir,\n&quot;,</span>
-<span class="doccomment">/// &quot; I am multiline\n&quot;,</span>
-<span class="doccomment">/// &quot;Next:Header&quot;).as_bytes())</span>
-<span class="doccomment">/// .unwrap();</span>
-<span class="doccomment">/// assert_eq!(parsed.get_key().unwrap(), &quot;Subject&quot;);</span>
-<span class="doccomment">/// assert_eq!(parsed.get_value().unwrap(), &quot;Hello, sir, I am multiline&quot;);</span>
-<span class="doccomment">/// ```</span>
-<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">parse_header</span>(<span class="ident">raw_data</span>: <span class="kw-2">&amp;</span>[<span class="ident">u8</span>]) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span>(<span class="ident">MailHeader</span>, <span class="ident">usize</span>), <span class="ident">MailParseError</span><span class="op">&gt;</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">it</span> <span class="op">=</span> <span class="ident">raw_data</span>.<span class="ident">iter</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">ix</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">c</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">it</span>.<span class="ident">next</span>() {
- <span class="prelude-val">None</span> <span class="op">=&gt;</span> <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">MailParseError</span>::<span class="ident">Generic</span>(<span class="string">&quot;Empty string provided&quot;</span>)),
- <span class="prelude-val">Some</span>(<span class="ident">v</span>) <span class="op">=&gt;</span> <span class="kw-2">*</span><span class="ident">v</span>,
- };
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">ix_key_end</span> <span class="op">=</span> <span class="prelude-val">None</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">ix_value_start</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">ix_value_end</span> <span class="op">=</span> <span class="number">0</span>;
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">state</span> <span class="op">=</span> <span class="ident">HeaderParseState</span>::<span class="ident">Initial</span>;
- <span class="kw">loop</span> {
- <span class="kw">match</span> <span class="ident">state</span> {
- <span class="ident">HeaderParseState</span>::<span class="ident">Initial</span> <span class="op">=&gt;</span> {
- <span class="kw">if</span> <span class="ident">c</span> <span class="op">==</span> <span class="string">b&#39; &#39;</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">MailParseError</span>::<span class="ident">Generic</span>(
- <span class="string">&quot;Header cannot start with a space; it is \
- likely an overhanging line from a \
- previous header&quot;</span>,
- ));
- };
- <span class="ident">state</span> <span class="op">=</span> <span class="ident">HeaderParseState</span>::<span class="ident">Key</span>;
- <span class="kw">continue</span>;
- }
- <span class="ident">HeaderParseState</span>::<span class="ident">Key</span> <span class="op">=&gt;</span> {
- <span class="kw">if</span> <span class="ident">c</span> <span class="op">==</span> <span class="string">b&#39;:&#39;</span> {
- <span class="ident">ix_key_end</span> <span class="op">=</span> <span class="prelude-val">Some</span>(<span class="ident">ix</span>);
- <span class="ident">state</span> <span class="op">=</span> <span class="ident">HeaderParseState</span>::<span class="ident">PreValue</span>;
- } <span class="kw">else</span> <span class="kw">if</span> <span class="ident">c</span> <span class="op">==</span> <span class="string">b&#39;\n&#39;</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">MailParseError</span>::<span class="ident">Generic</span>(<span class="string">&quot;Unexpected newline in header key&quot;</span>));
- }
- }
- <span class="ident">HeaderParseState</span>::<span class="ident">PreValue</span> <span class="op">=&gt;</span> {
- <span class="kw">if</span> <span class="ident">c</span> <span class="op">!=</span> <span class="string">b&#39; &#39;</span> {
- <span class="ident">ix_value_start</span> <span class="op">=</span> <span class="ident">ix</span>;
- <span class="ident">ix_value_end</span> <span class="op">=</span> <span class="ident">ix</span>;
- <span class="ident">state</span> <span class="op">=</span> <span class="ident">HeaderParseState</span>::<span class="ident">Value</span>;
- <span class="kw">continue</span>;
- }
- }
- <span class="ident">HeaderParseState</span>::<span class="ident">Value</span> <span class="op">=&gt;</span> {
- <span class="kw">if</span> <span class="ident">c</span> <span class="op">==</span> <span class="string">b&#39;\n&#39;</span> {
- <span class="ident">state</span> <span class="op">=</span> <span class="ident">HeaderParseState</span>::<span class="ident">ValueNewline</span>;
- } <span class="kw">else</span> {
- <span class="ident">ix_value_end</span> <span class="op">=</span> <span class="ident">ix</span> <span class="op">+</span> <span class="number">1</span>;
- }
- }
- <span class="ident">HeaderParseState</span>::<span class="ident">ValueNewline</span> <span class="op">=&gt;</span> {
- <span class="kw">if</span> <span class="ident">c</span> <span class="op">==</span> <span class="string">b&#39; &#39;</span> <span class="op">||</span> <span class="ident">c</span> <span class="op">==</span> <span class="string">b&#39;\t&#39;</span> {
- <span class="ident">state</span> <span class="op">=</span> <span class="ident">HeaderParseState</span>::<span class="ident">Value</span>;
- <span class="kw">continue</span>;
- } <span class="kw">else</span> {
- <span class="kw">break</span>;
- }
- }
- }
- <span class="ident">ix</span> <span class="op">=</span> <span class="ident">ix</span> <span class="op">+</span> <span class="number">1</span>;
- <span class="ident">c</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">it</span>.<span class="ident">next</span>() {
- <span class="prelude-val">None</span> <span class="op">=&gt;</span> <span class="kw">break</span>,
- <span class="prelude-val">Some</span>(<span class="ident">v</span>) <span class="op">=&gt;</span> <span class="kw-2">*</span><span class="ident">v</span>,
- };
- }
- <span class="kw">match</span> <span class="ident">ix_key_end</span> {
- <span class="prelude-val">Some</span>(<span class="ident">v</span>) <span class="op">=&gt;</span> {
- <span class="prelude-val">Ok</span>((
- <span class="ident">MailHeader</span> {
- <span class="ident">key</span>: <span class="kw-2">&amp;</span><span class="ident">raw_data</span>[<span class="number">0</span>..<span class="ident">v</span>],
- <span class="ident">value</span>: <span class="kw-2">&amp;</span><span class="ident">raw_data</span>[<span class="ident">ix_value_start</span>..<span class="ident">ix_value_end</span>],
- },
- <span class="ident">ix</span>,
- ))
- }
-
- <span class="prelude-val">None</span> <span class="op">=&gt;</span> <span class="prelude-val">Err</span>(<span class="ident">MailParseError</span>::<span class="ident">Generic</span>(
- <span class="string">&quot;Unable to determine end of the header key component&quot;</span>,
- )),
- }
-}
-
-<span class="doccomment">/// A trait that is implemented by the Vec&lt;MailHeader&gt; returned by the parse_headers</span>
-<span class="doccomment">/// function. It provides a map-like interface to look up header values by their</span>
-<span class="doccomment">/// name.</span>
-<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">MailHeaderMap</span> {
- <span class="doccomment">/// Look through the list of headers and return the value of the first one</span>
- <span class="doccomment">/// that matches the provided key. It returns Ok(None) if the no matching</span>
- <span class="doccomment">/// header was found. Header names are matched case-insensitively.</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// # Examples</span>
- <span class="doccomment">/// ```</span>
- <span class="doccomment">/// use mailparse::{parse_mail, MailHeaderMap};</span>
- <span class="doccomment">/// let headers = parse_mail(concat!(</span>
- <span class="doccomment">/// &quot;Subject: Test\n&quot;,</span>
- <span class="doccomment">/// &quot;\n&quot;,</span>
- <span class="doccomment">/// &quot;This is a test message&quot;).as_bytes())</span>
- <span class="doccomment">/// .unwrap().headers;</span>
- <span class="doccomment">/// assert_eq!(headers.get_first_value(&quot;Subject&quot;).unwrap(), Some(&quot;Test&quot;.to_string()));</span>
- <span class="doccomment">/// ```</span>
- <span class="kw">fn</span> <span class="ident">get_first_value</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">key</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span>, <span class="ident">MailParseError</span><span class="op">&gt;</span>;
-
- <span class="doccomment">/// Look through the list of headers and return the values of all headers</span>
- <span class="doccomment">/// matching the provided key. Returns an empty vector if no matching headers</span>
- <span class="doccomment">/// were found. The order of the returned values is the same as the order</span>
- <span class="doccomment">/// of the matching headers in the message. Header names are matched</span>
- <span class="doccomment">/// case-insensitively.</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// # Examples</span>
- <span class="doccomment">/// ```</span>
- <span class="doccomment">/// use mailparse::{parse_mail, MailHeaderMap};</span>
- <span class="doccomment">/// let headers = parse_mail(concat!(</span>
- <span class="doccomment">/// &quot;Key: Value1\n&quot;,</span>
- <span class="doccomment">/// &quot;Key: Value2&quot;).as_bytes())</span>
- <span class="doccomment">/// .unwrap().headers;</span>
- <span class="doccomment">/// assert_eq!(headers.get_all_values(&quot;Key&quot;).unwrap(),</span>
- <span class="doccomment">/// vec![&quot;Value1&quot;.to_string(), &quot;Value2&quot;.to_string()]);</span>
- <span class="doccomment">/// ```</span>
- <span class="kw">fn</span> <span class="ident">get_all_values</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">key</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span>, <span class="ident">MailParseError</span><span class="op">&gt;</span>;
-}
-
-<span class="kw">impl</span><span class="op">&lt;</span><span class="lifetime">&#39;a</span><span class="op">&gt;</span> <span class="ident">MailHeaderMap</span> <span class="kw">for</span> <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">MailHeader</span><span class="op">&lt;</span><span class="lifetime">&#39;a</span><span class="op">&gt;&gt;</span> {
- <span class="kw">fn</span> <span class="ident">get_first_value</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">key</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="prelude-ty">Option</span><span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span>, <span class="ident">MailParseError</span><span class="op">&gt;</span> {
- <span class="kw">for</span> <span class="ident">x</span> <span class="kw">in</span> <span class="self">self</span> {
- <span class="kw">if</span> <span class="macro">try</span><span class="macro">!</span>(<span class="ident">x</span>.<span class="ident">get_key</span>()).<span class="ident">eq_ignore_ascii_case</span>(<span class="ident">key</span>) {
- <span class="kw">return</span> <span class="ident">x</span>.<span class="ident">get_value</span>().<span class="ident">map</span>(<span class="op">|</span><span class="ident">v</span><span class="op">|</span> <span class="prelude-val">Some</span>(<span class="ident">v</span>));
- }
- }
- <span class="prelude-val">Ok</span>(<span class="prelude-val">None</span>)
- }
-
- <span class="kw">fn</span> <span class="ident">get_all_values</span>(<span class="kw-2">&amp;</span><span class="self">self</span>, <span class="ident">key</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span>, <span class="ident">MailParseError</span><span class="op">&gt;</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">values</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
- <span class="kw">for</span> <span class="ident">x</span> <span class="kw">in</span> <span class="self">self</span> {
- <span class="kw">if</span> <span class="macro">try</span><span class="macro">!</span>(<span class="ident">x</span>.<span class="ident">get_key</span>()).<span class="ident">eq_ignore_ascii_case</span>(<span class="ident">key</span>) {
- <span class="ident">values</span>.<span class="ident">push</span>(<span class="macro">try</span><span class="macro">!</span>(<span class="ident">x</span>.<span class="ident">get_value</span>()));
- }
- }
- <span class="prelude-val">Ok</span>(<span class="ident">values</span>)
- }
-}
-
-<span class="doccomment">/// Parses all the headers from the raw data given.</span>
-<span class="doccomment">/// This function takes raw byte data, and starts parsing it, expecting there</span>
-<span class="doccomment">/// to be zero or more MIME header key-value pair right at the beginning,</span>
-<span class="doccomment">/// followed by two consecutive newlines (i.e. a blank line). It parses those</span>
-<span class="doccomment">/// headers and returns them in a vector. The normal vector functions can be</span>
-<span class="doccomment">/// used to access the headers linearly, or the MailHeaderMap trait can be used</span>
-<span class="doccomment">/// to access them in a map-like fashion. Along with this vector, the function</span>
-<span class="doccomment">/// returns the index at which the message body is expected to start. If you</span>
-<span class="doccomment">/// just care about the headers, you can ignore the second component of the</span>
-<span class="doccomment">/// returned tuple.</span>
-<span class="doccomment">/// Error values are returned if there was some sort of parsing error.</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// # Examples</span>
-<span class="doccomment">/// ```</span>
-<span class="doccomment">/// use mailparse::{parse_headers, MailHeaderMap};</span>
-<span class="doccomment">/// let (headers, _) = parse_headers(concat!(</span>
-<span class="doccomment">/// &quot;Subject: Test\n&quot;,</span>
-<span class="doccomment">/// &quot;From: me@myself.com\n&quot;,</span>
-<span class="doccomment">/// &quot;To: you@yourself.com&quot;).as_bytes())</span>
-<span class="doccomment">/// .unwrap();</span>
-<span class="doccomment">/// assert_eq!(headers[1].get_key().unwrap(), &quot;From&quot;);</span>
-<span class="doccomment">/// assert_eq!(headers.get_first_value(&quot;To&quot;).unwrap(), Some(&quot;you@yourself.com&quot;.to_string()));</span>
-<span class="doccomment">/// ```</span>
-<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">parse_headers</span>(<span class="ident">raw_data</span>: <span class="kw-2">&amp;</span>[<span class="ident">u8</span>]) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span>(<span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">MailHeader</span><span class="op">&gt;</span>, <span class="ident">usize</span>), <span class="ident">MailParseError</span><span class="op">&gt;</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">headers</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">MailHeader</span><span class="op">&gt;</span> <span class="op">=</span> <span class="ident">Vec</span>::<span class="ident">new</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">ix</span> <span class="op">=</span> <span class="number">0</span>;
- <span class="kw">loop</span> {
- <span class="kw">if</span> <span class="ident">ix</span> <span class="op">&gt;=</span> <span class="ident">raw_data</span>.<span class="ident">len</span>() {
- <span class="kw">break</span>;
- } <span class="kw">else</span> <span class="kw">if</span> <span class="ident">raw_data</span>[<span class="ident">ix</span>] <span class="op">==</span> <span class="string">b&#39;\n&#39;</span> {
- <span class="ident">ix</span> <span class="op">=</span> <span class="ident">ix</span> <span class="op">+</span> <span class="number">1</span>;
- <span class="kw">break</span>;
- } <span class="kw">else</span> <span class="kw">if</span> <span class="ident">raw_data</span>[<span class="ident">ix</span>] <span class="op">==</span> <span class="string">b&#39;\r&#39;</span> {
- <span class="kw">if</span> <span class="ident">ix</span> <span class="op">+</span> <span class="number">1</span> <span class="op">&lt;</span> <span class="ident">raw_data</span>.<span class="ident">len</span>() <span class="op">&amp;&amp;</span> <span class="ident">raw_data</span>[<span class="ident">ix</span> <span class="op">+</span> <span class="number">1</span>] <span class="op">==</span> <span class="string">b&#39;\n&#39;</span> {
- <span class="ident">ix</span> <span class="op">=</span> <span class="ident">ix</span> <span class="op">+</span> <span class="number">2</span>;
- <span class="kw">break</span>;
- } <span class="kw">else</span> {
- <span class="kw">return</span> <span class="prelude-val">Err</span>(<span class="ident">MailParseError</span>::<span class="ident">Generic</span>(
- <span class="string">&quot;Headers were followed by an unexpected lone \
- CR character!&quot;</span>,
- ));
- }
- }
- <span class="kw">let</span> (<span class="ident">header</span>, <span class="ident">ix_next</span>) <span class="op">=</span> <span class="macro">try</span><span class="macro">!</span>(<span class="ident">parse_header</span>(<span class="kw-2">&amp;</span><span class="ident">raw_data</span>[<span class="ident">ix</span>..]));
- <span class="ident">headers</span>.<span class="ident">push</span>(<span class="ident">header</span>);
- <span class="ident">ix</span> <span class="op">=</span> <span class="ident">ix</span> <span class="op">+</span> <span class="ident">ix_next</span>;
- }
- <span class="prelude-val">Ok</span>((<span class="ident">headers</span>, <span class="ident">ix</span>))
-}
-
-<span class="doccomment">/// A struct to hold a more structured representation of the Content-Type header.</span>
-<span class="doccomment">/// This is provided mostly as a convenience since this metadata is usually</span>
-<span class="doccomment">/// needed to interpret the message body properly.</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">ParsedContentType</span> {
- <span class="doccomment">/// The type of the data, for example &quot;text/plain&quot; or &quot;application/pdf&quot;.</span>
- <span class="kw">pub</span> <span class="ident">mimetype</span>: <span class="ident">String</span>,
- <span class="doccomment">/// The charset used to decode the raw byte data, for example &quot;iso-8859-1&quot;</span>
- <span class="doccomment">/// or &quot;utf-8&quot;.</span>
- <span class="kw">pub</span> <span class="ident">charset</span>: <span class="ident">String</span>,
- <span class="doccomment">/// The additional params of Content-Type, e.g. filename and boundary. The</span>
- <span class="doccomment">/// keys in the map will be lowercased, and the values will have any</span>
- <span class="doccomment">/// enclosing quotes stripped.</span>
- <span class="kw">pub</span> <span class="ident">params</span>: <span class="ident">BTreeMap</span><span class="op">&lt;</span><span class="ident">String</span>, <span class="ident">String</span><span class="op">&gt;</span>,
-}
-
-<span class="kw">impl</span> <span class="ident">Default</span> <span class="kw">for</span> <span class="ident">ParsedContentType</span> {
- <span class="kw">fn</span> <span class="ident">default</span>() <span class="op">-&gt;</span> <span class="self">Self</span> {
- <span class="ident">ParsedContentType</span> {
- <span class="ident">mimetype</span>: <span class="string">&quot;text/plain&quot;</span>.<span class="ident">to_string</span>(),
- <span class="ident">charset</span>: <span class="string">&quot;us-ascii&quot;</span>.<span class="ident">to_string</span>(),
- <span class="ident">params</span>: <span class="ident">BTreeMap</span>::<span class="ident">new</span>(),
- }
- }
-}
-
-<span class="doccomment">/// Helper method to parse a header value as a Content-Type header. Note that</span>
-<span class="doccomment">/// the returned object&#39;s `params` map will contain a charset key if a charset</span>
-<span class="doccomment">/// was explicitly specified in the header; otherwise the `params` map will not</span>
-<span class="doccomment">/// contain a charset key. Regardless, the `charset` field will contain a</span>
-<span class="doccomment">/// charset - either the one explicitly specified or the default of &quot;us-ascii&quot;.</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// # Examples</span>
-<span class="doccomment">/// ```</span>
-<span class="doccomment">/// use mailparse::{parse_header, parse_content_type};</span>
-<span class="doccomment">/// let (parsed, _) = parse_header(</span>
-<span class="doccomment">/// b&quot;Content-Type: text/html; charset=foo; boundary=\&quot;quotes_are_removed\&quot;&quot;)</span>
-<span class="doccomment">/// .unwrap();</span>
-<span class="doccomment">/// let ctype = parse_content_type(&amp;parsed.get_value().unwrap());</span>
-<span class="doccomment">/// assert_eq!(ctype.mimetype, &quot;text/html&quot;);</span>
-<span class="doccomment">/// assert_eq!(ctype.charset, &quot;foo&quot;);</span>
-<span class="doccomment">/// assert_eq!(ctype.params.get(&quot;boundary&quot;), Some(&amp;&quot;quotes_are_removed&quot;.to_string()));</span>
-<span class="doccomment">/// assert_eq!(ctype.params.get(&quot;charset&quot;), Some(&amp;&quot;foo&quot;.to_string()));</span>
-<span class="doccomment">/// ```</span>
-<span class="doccomment">/// ```</span>
-<span class="doccomment">/// use mailparse::{parse_header, parse_content_type};</span>
-<span class="doccomment">/// let (parsed, _) = parse_header(b&quot;Content-Type: bogus&quot;).unwrap();</span>
-<span class="doccomment">/// let ctype = parse_content_type(&amp;parsed.get_value().unwrap());</span>
-<span class="doccomment">/// assert_eq!(ctype.mimetype, &quot;bogus&quot;);</span>
-<span class="doccomment">/// assert_eq!(ctype.charset, &quot;us-ascii&quot;);</span>
-<span class="doccomment">/// assert_eq!(ctype.params.get(&quot;boundary&quot;), None);</span>
-<span class="doccomment">/// assert_eq!(ctype.params.get(&quot;charset&quot;), None);</span>
-<span class="doccomment">/// ```</span>
-<span class="doccomment">/// ```</span>
-<span class="doccomment">/// use mailparse::{parse_header, parse_content_type};</span>
-<span class="doccomment">/// let (parsed, _) = parse_header(br#&quot;Content-Type: application/octet-stream;name=&quot;=?utf8?B?6L+O5ai255m95a+M576O?=&quot;;charset=&quot;utf8&quot;&quot;#).unwrap();</span>
-<span class="doccomment">/// let ctype = parse_content_type(&amp;parsed.get_value().unwrap());</span>
-<span class="doccomment">/// assert_eq!(ctype.mimetype, &quot;application/octet-stream&quot;);</span>
-<span class="doccomment">/// assert_eq!(ctype.charset, &quot;utf8&quot;);</span>
-<span class="doccomment">/// assert_eq!(ctype.params.get(&quot;boundary&quot;), None);</span>
-<span class="doccomment">/// assert_eq!(ctype.params.get(&quot;name&quot;), Some(&amp;&quot;迎娶白富美&quot;.to_string()));</span>
-<span class="doccomment">/// ```</span>
-<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">parse_content_type</span>(<span class="ident">header</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>) <span class="op">-&gt;</span> <span class="ident">ParsedContentType</span> {
- <span class="kw">let</span> <span class="ident">params</span> <span class="op">=</span> <span class="ident">parse_param_content</span>(<span class="ident">header</span>);
- <span class="kw">let</span> <span class="ident">mimetype</span> <span class="op">=</span> <span class="ident">params</span>.<span class="ident">value</span>.<span class="ident">to_lowercase</span>();
- <span class="kw">let</span> <span class="ident">charset</span> <span class="op">=</span> <span class="ident">params</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;charset&quot;</span>).<span class="ident">cloned</span>().<span class="ident">unwrap_or</span>(
- <span class="string">&quot;us-ascii&quot;</span>.<span class="ident">to_string</span>(),
- );
-
- <span class="ident">ParsedContentType</span> {
- <span class="ident">mimetype</span>: <span class="ident">mimetype</span>,
- <span class="ident">charset</span>: <span class="ident">charset</span>,
- <span class="ident">params</span>: <span class="ident">params</span>.<span class="ident">params</span>,
- }
-}
-
-<span class="doccomment">/// The possible disposition types in a Content-Disposition header. A more</span>
-<span class="doccomment">/// comprehensive list of IANA-recognized types can be found at</span>
-<span class="doccomment">/// https://www.iana.org/assignments/cont-disp/cont-disp.xhtml. This library</span>
-<span class="doccomment">/// only enumerates the types most commonly found in email messages, and</span>
-<span class="doccomment">/// provides the `Extension` value for holding all other types.</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Clone</span>, <span class="ident">PartialEq</span>)]</span>
-<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">DispositionType</span> {
- <span class="doccomment">/// Default value, indicating the content is to be displayed inline as</span>
- <span class="doccomment">/// part of the enclosing document.</span>
- <span class="ident">Inline</span>,
- <span class="doccomment">/// A disposition indicating the content is not meant for inline display,</span>
- <span class="doccomment">/// but whose content can be accessed for use.</span>
- <span class="ident">Attachment</span>,
- <span class="doccomment">/// A disposition indicating the content contains a form submission.</span>
- <span class="ident">FormData</span>,
- <span class="doccomment">/// Extension type to hold any disposition not explicitly enumerated.</span>
- <span class="ident">Extension</span>(<span class="ident">String</span>),
-}
-
-<span class="kw">impl</span> <span class="ident">Default</span> <span class="kw">for</span> <span class="ident">DispositionType</span> {
- <span class="kw">fn</span> <span class="ident">default</span>() <span class="op">-&gt;</span> <span class="self">Self</span> {
- <span class="ident">DispositionType</span>::<span class="ident">Inline</span>
- }
-}
-
-<span class="doccomment">/// Convert the string represented disposition type to enum.</span>
-<span class="kw">fn</span> <span class="ident">parse_disposition_type</span>(<span class="ident">disposition</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>) <span class="op">-&gt;</span> <span class="ident">DispositionType</span> {
- <span class="kw">match</span> <span class="kw-2">&amp;</span><span class="ident">disposition</span>.<span class="ident">to_lowercase</span>()[..] {
- <span class="string">&quot;inline&quot;</span> <span class="op">=&gt;</span> <span class="ident">DispositionType</span>::<span class="ident">Inline</span>,
- <span class="string">&quot;attachment&quot;</span> <span class="op">=&gt;</span> <span class="ident">DispositionType</span>::<span class="ident">Attachment</span>,
- <span class="string">&quot;form-data&quot;</span> <span class="op">=&gt;</span> <span class="ident">DispositionType</span>::<span class="ident">FormData</span>,
- <span class="ident">extension</span> <span class="op">=&gt;</span> <span class="ident">DispositionType</span>::<span class="ident">Extension</span>(<span class="ident">extension</span>.<span class="ident">to_string</span>()),
- }
-}
-
-<span class="doccomment">/// A struct to hold a more structured representation of the Content-Disposition header.</span>
-<span class="doccomment">/// This is provided mostly as a convenience since this metadata is usually</span>
-<span class="doccomment">/// needed to interpret the message body properly.</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>, <span class="ident">Default</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">ParsedContentDisposition</span> {
- <span class="doccomment">/// The disposition type of the Content-Disposition header. If this</span>
- <span class="doccomment">/// is an extension type, the string will be lowercased.</span>
- <span class="kw">pub</span> <span class="ident">disposition</span>: <span class="ident">DispositionType</span>,
- <span class="doccomment">/// The additional params of Content-Disposition, e.g. filename. The</span>
- <span class="doccomment">/// keys in the map will be lowercased, and the values will have any</span>
- <span class="doccomment">/// enclosing quotes stripped.</span>
- <span class="kw">pub</span> <span class="ident">params</span>: <span class="ident">BTreeMap</span><span class="op">&lt;</span><span class="ident">String</span>, <span class="ident">String</span><span class="op">&gt;</span>,
-}
-
-<span class="doccomment">/// Helper method to parse a header value as a Content-Disposition header. The disposition</span>
-<span class="doccomment">/// defaults to &quot;inline&quot; if no disposition parameter is provided in the header</span>
-<span class="doccomment">/// value.</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// # Examples</span>
-<span class="doccomment">/// ```</span>
-<span class="doccomment">/// use mailparse::{parse_header, parse_content_disposition, DispositionType};</span>
-<span class="doccomment">/// let (parsed, _) = parse_header(</span>
-<span class="doccomment">/// b&quot;Content-Disposition: attachment; filename=\&quot;yummy dummy\&quot;&quot;)</span>
-<span class="doccomment">/// .unwrap();</span>
-<span class="doccomment">/// let dis = parse_content_disposition(&amp;parsed.get_value().unwrap());</span>
-<span class="doccomment">/// assert_eq!(dis.disposition, DispositionType::Attachment);</span>
-<span class="doccomment">/// assert_eq!(dis.params.get(&quot;name&quot;), None);</span>
-<span class="doccomment">/// assert_eq!(dis.params.get(&quot;filename&quot;), Some(&amp;&quot;yummy dummy&quot;.to_string()));</span>
-<span class="doccomment">/// ```</span>
-<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">parse_content_disposition</span>(<span class="ident">header</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>) <span class="op">-&gt;</span> <span class="ident">ParsedContentDisposition</span> {
- <span class="kw">let</span> <span class="ident">params</span> <span class="op">=</span> <span class="ident">parse_param_content</span>(<span class="ident">header</span>);
- <span class="kw">let</span> <span class="ident">disposition</span> <span class="op">=</span> <span class="ident">parse_disposition_type</span>(<span class="kw-2">&amp;</span><span class="ident">params</span>.<span class="ident">value</span>);
- <span class="ident">ParsedContentDisposition</span> {
- <span class="ident">disposition</span>: <span class="ident">disposition</span>,
- <span class="ident">params</span>: <span class="ident">params</span>.<span class="ident">params</span>,
- }
-}
-
-<span class="doccomment">/// Struct that holds the structured representation of the message. Note that</span>
-<span class="doccomment">/// since MIME allows for nested multipart messages, a tree-like structure is</span>
-<span class="doccomment">/// necessary to represent it properly. This struct accomplishes that by holding</span>
-<span class="doccomment">/// a vector of other ParsedMail structures for the subparts.</span>
-<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">Debug</span>)]</span>
-<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">ParsedMail</span><span class="op">&lt;</span><span class="lifetime">&#39;a</span><span class="op">&gt;</span> {
- <span class="doccomment">/// The headers for the message (or message subpart).</span>
- <span class="kw">pub</span> <span class="ident">headers</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">MailHeader</span><span class="op">&lt;</span><span class="lifetime">&#39;a</span><span class="op">&gt;&gt;</span>,
- <span class="doccomment">/// The Content-Type information for the message (or message subpart).</span>
- <span class="kw">pub</span> <span class="ident">ctype</span>: <span class="ident">ParsedContentType</span>,
- <span class="doccomment">/// The raw bytes that make up the body of the message (or message subpart).</span>
- <span class="ident">body</span>: <span class="kw-2">&amp;</span><span class="lifetime">&#39;a</span> [<span class="ident">u8</span>],
- <span class="doccomment">/// The subparts of this message or subpart. This vector is only non-empty</span>
- <span class="doccomment">/// if ctype.mimetype starts with &quot;multipart/&quot;.</span>
- <span class="kw">pub</span> <span class="ident">subparts</span>: <span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">ParsedMail</span><span class="op">&lt;</span><span class="lifetime">&#39;a</span><span class="op">&gt;&gt;</span>,
-}
-
-<span class="kw">impl</span><span class="op">&lt;</span><span class="lifetime">&#39;a</span><span class="op">&gt;</span> <span class="ident">ParsedMail</span><span class="op">&lt;</span><span class="lifetime">&#39;a</span><span class="op">&gt;</span> {
- <span class="doccomment">/// Get the body of the message as a Rust string. This function tries to</span>
- <span class="doccomment">/// unapply the Content-Transfer-Encoding if there is one, and then converts</span>
- <span class="doccomment">/// the result into a Rust UTF-8 string using the charset in the Content-Type</span>
- <span class="doccomment">/// (or &quot;us-ascii&quot; if the charset was missing or not recognized).</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// # Examples</span>
- <span class="doccomment">/// ```</span>
- <span class="doccomment">/// use mailparse::parse_mail;</span>
- <span class="doccomment">/// let p = parse_mail(concat!(</span>
- <span class="doccomment">/// &quot;Subject: test\n&quot;,</span>
- <span class="doccomment">/// &quot;\n&quot;,</span>
- <span class="doccomment">/// &quot;This is the body&quot;).as_bytes())</span>
- <span class="doccomment">/// .unwrap();</span>
- <span class="doccomment">/// assert_eq!(p.get_body().unwrap(), &quot;This is the body&quot;);</span>
- <span class="doccomment">/// ```</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_body</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">String</span>, <span class="ident">MailParseError</span><span class="op">&gt;</span> {
- <span class="kw">let</span> <span class="ident">decoded</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">get_body_raw</span>()<span class="question-mark">?</span>;
- <span class="kw">let</span> <span class="ident">charset_conv</span> <span class="op">=</span> <span class="ident">encoding</span>::<span class="ident">label</span>::<span class="ident">encoding_from_whatwg_label</span>(<span class="kw-2">&amp;</span><span class="self">self</span>.<span class="ident">ctype</span>.<span class="ident">charset</span>)
- .<span class="ident">unwrap_or</span>(<span class="ident">encoding</span>::<span class="ident">all</span>::<span class="ident">ASCII</span>);
- <span class="kw">let</span> <span class="ident">str_body</span> <span class="op">=</span> <span class="macro">try</span><span class="macro">!</span>(<span class="ident">charset_conv</span>.<span class="ident">decode</span>(
- <span class="kw-2">&amp;</span><span class="ident">decoded</span>,
- <span class="ident">encoding</span>::<span class="ident">DecoderTrap</span>::<span class="ident">Replace</span>,
- ));
- <span class="prelude-val">Ok</span>(<span class="ident">str_body</span>)
- }
-
- <span class="doccomment">/// Get the body of the message as a Rust Vec&lt;u8&gt;. This function tries to</span>
- <span class="doccomment">/// unapply the Content-Transfer-Encoding if there is one, but won&#39;t do</span>
- <span class="doccomment">/// any charset decoding.</span>
- <span class="doccomment">///</span>
- <span class="doccomment">/// # Examples</span>
- <span class="doccomment">/// ```</span>
- <span class="doccomment">/// use mailparse::parse_mail;</span>
- <span class="doccomment">/// let p = parse_mail(concat!(</span>
- <span class="doccomment">/// &quot;Subject: test\n&quot;,</span>
- <span class="doccomment">/// &quot;\n&quot;,</span>
- <span class="doccomment">/// &quot;This is the body&quot;).as_bytes())</span>
- <span class="doccomment">/// .unwrap();</span>
- <span class="doccomment">/// assert_eq!(p.get_body_raw().unwrap(), b&quot;This is the body&quot;);</span>
- <span class="doccomment">/// ```</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_body_raw</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">u8</span><span class="op">&gt;</span>, <span class="ident">MailParseError</span><span class="op">&gt;</span> {
- <span class="kw">let</span> <span class="ident">transfer_coding</span> <span class="op">=</span> <span class="macro">try</span><span class="macro">!</span>(<span class="self">self</span>.<span class="ident">headers</span>.<span class="ident">get_first_value</span>(<span class="string">&quot;Content-Transfer-Encoding&quot;</span>))
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">s</span><span class="op">|</span> <span class="ident">s</span>.<span class="ident">to_lowercase</span>());
- <span class="kw">let</span> <span class="ident">decoded</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">transfer_coding</span>.<span class="ident">unwrap_or</span>(<span class="ident">String</span>::<span class="ident">new</span>()).<span class="ident">as_ref</span>() {
- <span class="string">&quot;base64&quot;</span> <span class="op">=&gt;</span> {
- <span class="kw">let</span> <span class="ident">cleaned</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">body</span>
- .<span class="ident">iter</span>()
- .<span class="ident">filter_map</span>(<span class="op">|</span><span class="kw-2">&amp;</span><span class="ident">c</span><span class="op">|</span> <span class="kw">match</span> <span class="ident">c</span> {
- <span class="string">b&#39; &#39;</span> <span class="op">|</span> <span class="string">b&#39;\t&#39;</span> <span class="op">|</span> <span class="string">b&#39;\r&#39;</span> <span class="op">|</span> <span class="string">b&#39;\n&#39;</span> <span class="op">=&gt;</span> <span class="prelude-val">None</span>,
- <span class="ident">v</span> <span class="op">=&gt;</span> <span class="prelude-val">Some</span>(<span class="ident">v</span>),
- })
- .<span class="ident">collect</span>::<span class="op">&lt;</span><span class="ident">Vec</span><span class="op">&lt;</span><span class="ident">u8</span><span class="op">&gt;&gt;</span>();
- <span class="macro">try</span><span class="macro">!</span>(<span class="ident">base64</span>::<span class="ident">decode</span>(<span class="kw-2">&amp;</span><span class="ident">cleaned</span>))
- }
- <span class="string">&quot;quoted-printable&quot;</span> <span class="op">=&gt;</span> {
- <span class="macro">try</span><span class="macro">!</span>(<span class="ident">quoted_printable</span>::<span class="ident">decode</span>(
- <span class="self">self</span>.<span class="ident">body</span>,
- <span class="ident">quoted_printable</span>::<span class="ident">ParseMode</span>::<span class="ident">Robust</span>,
- ))
- }
- <span class="kw">_</span> <span class="op">=&gt;</span> <span class="ident">Vec</span>::<span class="op">&lt;</span><span class="ident">u8</span><span class="op">&gt;</span>::<span class="ident">from</span>(<span class="self">self</span>.<span class="ident">body</span>),
- };
- <span class="prelude-val">Ok</span>(<span class="ident">decoded</span>)
- }
-
- <span class="doccomment">/// Returns a struct containing a parsed representation of the</span>
- <span class="doccomment">/// Content-Disposition header. The first header with this name</span>
- <span class="doccomment">/// is used, if there are multiple. See the `parse_content_disposition`</span>
- <span class="doccomment">/// method documentation for more details on the semantics of the</span>
- <span class="doccomment">/// returned object.</span>
- <span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_content_disposition</span>(<span class="kw-2">&amp;</span><span class="self">self</span>) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ParsedContentDisposition</span>, <span class="ident">MailParseError</span><span class="op">&gt;</span> {
- <span class="kw">let</span> <span class="ident">disposition</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">headers</span>
- .<span class="ident">get_first_value</span>(<span class="string">&quot;Content-Disposition&quot;</span>)<span class="question-mark">?</span>
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">s</span><span class="op">|</span> <span class="ident">parse_content_disposition</span>(<span class="kw-2">&amp;</span><span class="ident">s</span>))
- .<span class="ident">unwrap_or_default</span>();
- <span class="prelude-val">Ok</span>(<span class="ident">disposition</span>)
- }
-}
-
-<span class="doccomment">/// The main mail-parsing entry point.</span>
-<span class="doccomment">/// This function takes the raw data making up the message body and returns a</span>
-<span class="doccomment">/// structured version of it, which allows easily accessing the header and body</span>
-<span class="doccomment">/// information as needed.</span>
-<span class="doccomment">///</span>
-<span class="doccomment">/// # Examples</span>
-<span class="doccomment">/// ```</span>
-<span class="doccomment">/// use mailparse::*;</span>
-<span class="doccomment">/// let parsed = parse_mail(concat!(</span>
-<span class="doccomment">/// &quot;Subject: This is a test email\n&quot;,</span>
-<span class="doccomment">/// &quot;Content-Type: multipart/alternative; boundary=foobar\n&quot;,</span>
-<span class="doccomment">/// &quot;Date: Sun, 02 Oct 2016 07:06:22 -0700 (PDT)\n&quot;,</span>
-<span class="doccomment">/// &quot;\n&quot;,</span>
-<span class="doccomment">/// &quot;--foobar\n&quot;,</span>
-<span class="doccomment">/// &quot;Content-Type: text/plain; charset=utf-8\n&quot;,</span>
-<span class="doccomment">/// &quot;Content-Transfer-Encoding: quoted-printable\n&quot;,</span>
-<span class="doccomment">/// &quot;\n&quot;,</span>
-<span class="doccomment">/// &quot;This is the plaintext version, in utf-8. Proof by Euro: =E2=82=AC\n&quot;,</span>
-<span class="doccomment">/// &quot;--foobar\n&quot;,</span>
-<span class="doccomment">/// &quot;Content-Type: text/html\n&quot;,</span>
-<span class="doccomment">/// &quot;Content-Transfer-Encoding: base64\n&quot;,</span>
-<span class="doccomment">/// &quot;\n&quot;,</span>
-<span class="doccomment">/// &quot;PGh0bWw+PGJvZHk+VGhpcyBpcyB0aGUgPGI+SFRNTDwvYj4gdmVyc2lvbiwgaW4g \n&quot;,</span>
-<span class="doccomment">/// &quot;dXMtYXNjaWkuIFByb29mIGJ5IEV1cm86ICZldXJvOzwvYm9keT48L2h0bWw+Cg== \n&quot;,</span>
-<span class="doccomment">/// &quot;--foobar--\n&quot;,</span>
-<span class="doccomment">/// &quot;After the final boundary stuff gets ignored.\n&quot;).as_bytes())</span>
-<span class="doccomment">/// .unwrap();</span>
-<span class="doccomment">/// assert_eq!(parsed.headers.get_first_value(&quot;Subject&quot;).unwrap(),</span>
-<span class="doccomment">/// Some(&quot;This is a test email&quot;.to_string()));</span>
-<span class="doccomment">/// assert_eq!(parsed.subparts.len(), 2);</span>
-<span class="doccomment">/// assert_eq!(parsed.subparts[0].get_body().unwrap(),</span>
-<span class="doccomment">/// &quot;This is the plaintext version, in utf-8. Proof by Euro: \u{20AC}&quot;);</span>
-<span class="doccomment">/// assert_eq!(parsed.subparts[1].headers[1].get_value().unwrap(), &quot;base64&quot;);</span>
-<span class="doccomment">/// assert_eq!(parsed.subparts[1].ctype.mimetype, &quot;text/html&quot;);</span>
-<span class="doccomment">/// assert!(parsed.subparts[1].get_body().unwrap().starts_with(&quot;&lt;html&gt;&quot;));</span>
-<span class="doccomment">/// assert_eq!(dateparse(parsed.headers.get_first_value(&quot;Date&quot;).unwrap().unwrap().as_str()).unwrap(), 1475417182);</span>
-<span class="doccomment">/// ```</span>
-<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">parse_mail</span>(<span class="ident">raw_data</span>: <span class="kw-2">&amp;</span>[<span class="ident">u8</span>]) <span class="op">-&gt;</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ParsedMail</span>, <span class="ident">MailParseError</span><span class="op">&gt;</span> {
- <span class="kw">let</span> (<span class="ident">headers</span>, <span class="ident">ix_body</span>) <span class="op">=</span> <span class="macro">try</span><span class="macro">!</span>(<span class="ident">parse_headers</span>(<span class="ident">raw_data</span>));
- <span class="kw">let</span> <span class="ident">ctype</span> <span class="op">=</span> <span class="ident">headers</span>
- .<span class="ident">get_first_value</span>(<span class="string">&quot;Content-Type&quot;</span>)<span class="question-mark">?</span>
- .<span class="ident">map</span>(<span class="op">|</span><span class="ident">s</span><span class="op">|</span> <span class="ident">parse_content_type</span>(<span class="kw-2">&amp;</span><span class="ident">s</span>))
- .<span class="ident">unwrap_or_default</span>();
-
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">result</span> <span class="op">=</span> <span class="ident">ParsedMail</span> {
- <span class="ident">headers</span>: <span class="ident">headers</span>,
- <span class="ident">ctype</span>: <span class="ident">ctype</span>,
- <span class="ident">body</span>: <span class="kw-2">&amp;</span><span class="ident">raw_data</span>[<span class="ident">ix_body</span>..],
- <span class="ident">subparts</span>: <span class="ident">Vec</span>::<span class="op">&lt;</span><span class="ident">ParsedMail</span><span class="op">&gt;</span>::<span class="ident">new</span>(),
- };
- <span class="kw">if</span> <span class="ident">result</span>.<span class="ident">ctype</span>.<span class="ident">mimetype</span>.<span class="ident">starts_with</span>(<span class="string">&quot;multipart/&quot;</span>) <span class="op">&amp;&amp;</span>
- <span class="ident">result</span>.<span class="ident">ctype</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;boundary&quot;</span>).<span class="ident">is_some</span>() <span class="op">&amp;&amp;</span> <span class="ident">raw_data</span>.<span class="ident">len</span>() <span class="op">&gt;</span> <span class="ident">ix_body</span>
- {
- <span class="kw">let</span> <span class="ident">boundary</span> <span class="op">=</span> <span class="ident">String</span>::<span class="ident">from</span>(<span class="string">&quot;--&quot;</span>) <span class="op">+</span> <span class="ident">result</span>.<span class="ident">ctype</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;boundary&quot;</span>).<span class="ident">unwrap</span>();
- <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">ix_body_end</span>) <span class="op">=</span> <span class="ident">find_from_u8</span>(<span class="ident">raw_data</span>, <span class="ident">ix_body</span>, <span class="ident">boundary</span>.<span class="ident">as_bytes</span>()) {
- <span class="ident">result</span>.<span class="ident">body</span> <span class="op">=</span> <span class="kw-2">&amp;</span><span class="ident">raw_data</span>[<span class="ident">ix_body</span>..<span class="ident">ix_body_end</span>];
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">ix_boundary_end</span> <span class="op">=</span> <span class="ident">ix_body_end</span> <span class="op">+</span> <span class="ident">boundary</span>.<span class="ident">len</span>();
- <span class="kw">while</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">ix_part_start</span>) <span class="op">=</span>
- <span class="ident">find_from_u8</span>(<span class="ident">raw_data</span>, <span class="ident">ix_boundary_end</span>, <span class="string">b&quot;\n&quot;</span>).<span class="ident">map</span>(<span class="op">|</span><span class="ident">v</span><span class="op">|</span> <span class="ident">v</span> <span class="op">+</span> <span class="number">1</span>)
- {
- <span class="comment">// if there is no terminating boundary, assume the part end is the end of the email</span>
- <span class="kw">let</span> <span class="ident">ix_part_end</span> <span class="op">=</span> <span class="ident">find_from_u8</span>(<span class="ident">raw_data</span>, <span class="ident">ix_part_start</span>, <span class="ident">boundary</span>.<span class="ident">as_bytes</span>()).<span class="ident">unwrap_or</span>(<span class="ident">raw_data</span>.<span class="ident">len</span>());
-
- <span class="ident">result</span>.<span class="ident">subparts</span>.<span class="ident">push</span>(<span class="macro">try</span><span class="macro">!</span>(<span class="ident">parse_mail</span>(
- <span class="kw-2">&amp;</span><span class="ident">raw_data</span>[<span class="ident">ix_part_start</span>..<span class="ident">ix_part_end</span>],
- )));
- <span class="ident">ix_boundary_end</span> <span class="op">=</span> <span class="ident">ix_part_end</span> <span class="op">+</span> <span class="ident">boundary</span>.<span class="ident">len</span>();
- <span class="kw">if</span> <span class="ident">ix_boundary_end</span> <span class="op">+</span> <span class="number">2</span> <span class="op">&gt;</span> <span class="ident">raw_data</span>.<span class="ident">len</span>() <span class="op">||</span>
- (<span class="ident">raw_data</span>[<span class="ident">ix_boundary_end</span>] <span class="op">==</span> <span class="string">b&#39;-&#39;</span> <span class="op">&amp;&amp;</span> <span class="ident">raw_data</span>[<span class="ident">ix_boundary_end</span> <span class="op">+</span> <span class="number">1</span>] <span class="op">==</span> <span class="string">b&#39;-&#39;</span>)
- {
- <span class="kw">break</span>;
- }
- }
- }
- }
- <span class="prelude-val">Ok</span>(<span class="ident">result</span>)
-}
-
-<span class="doccomment">/// Used to store params for content-type and content-disposition</span>
-<span class="kw">struct</span> <span class="ident">ParamContent</span> {
- <span class="ident">value</span>: <span class="ident">String</span>,
- <span class="ident">params</span>: <span class="ident">BTreeMap</span><span class="op">&lt;</span><span class="ident">String</span>, <span class="ident">String</span><span class="op">&gt;</span>,
-}
-
-<span class="doccomment">/// Parse parameterized header values such as that for Content-Type</span>
-<span class="doccomment">/// e.g. `multipart/alternative; boundary=foobar`</span>
-<span class="doccomment">/// Note: this function is not made public as it may require</span>
-<span class="doccomment">/// significant changes to be fully correct. For instance,</span>
-<span class="doccomment">/// it does not handle quoted parameter values containing the</span>
-<span class="doccomment">/// semicolon (&#39;;&#39;) character. It also produces a BTreeMap,</span>
-<span class="doccomment">/// which implicitly does not support multiple parameters with</span>
-<span class="doccomment">/// the same key. The format for parameterized header values</span>
-<span class="doccomment">/// doesn&#39;t appear to be strongly specified anywhere.</span>
-<span class="kw">fn</span> <span class="ident">parse_param_content</span>(<span class="ident">content</span>: <span class="kw-2">&amp;</span><span class="ident">str</span>) <span class="op">-&gt;</span> <span class="ident">ParamContent</span> {
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">tokens</span> <span class="op">=</span> <span class="ident">content</span>.<span class="ident">split</span>(<span class="string">&#39;;&#39;</span>);
- <span class="comment">// There must be at least one token produced by split, even if it&#39;s empty.</span>
- <span class="kw">let</span> <span class="ident">value</span> <span class="op">=</span> <span class="ident">tokens</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>().<span class="ident">trim</span>();
- <span class="kw">let</span> <span class="ident">map</span> <span class="op">=</span> <span class="ident">tokens</span>
- .<span class="ident">filter_map</span>(<span class="op">|</span><span class="ident">kv</span><span class="op">|</span> <span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">idx</span>) <span class="op">=</span> <span class="ident">kv</span>.<span class="ident">find</span>(<span class="string">&#39;=&#39;</span>) {
- <span class="kw">let</span> <span class="ident">key</span> <span class="op">=</span> <span class="ident">kv</span>[<span class="number">0</span>..<span class="ident">idx</span>].<span class="ident">trim</span>().<span class="ident">to_lowercase</span>();
- <span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">value</span> <span class="op">=</span> <span class="ident">kv</span>[<span class="ident">idx</span> <span class="op">+</span> <span class="number">1</span>..].<span class="ident">trim</span>();
- <span class="kw">if</span> <span class="ident">value</span>.<span class="ident">starts_with</span>(<span class="string">&#39;&quot;&#39;</span>) <span class="op">&amp;&amp;</span> <span class="ident">value</span>.<span class="ident">ends_with</span>(<span class="string">&#39;&quot;&#39;</span>) {
- <span class="ident">value</span> <span class="op">=</span> <span class="kw-2">&amp;</span><span class="ident">value</span>[<span class="number">1</span>..<span class="ident">value</span>.<span class="ident">len</span>() <span class="op">-</span> <span class="number">1</span>];
- }
- <span class="prelude-val">Some</span>((<span class="ident">key</span>, <span class="ident">value</span>.<span class="ident">to_string</span>()))
- } <span class="kw">else</span> {
- <span class="prelude-val">None</span>
- })
- .<span class="ident">collect</span>();
-
- <span class="ident">ParamContent</span> {
- <span class="ident">value</span>: <span class="ident">value</span>.<span class="ident">into</span>(),
- <span class="ident">params</span>: <span class="ident">map</span>,
- }
-}
-
-<span class="attribute">#[<span class="ident">cfg</span>(<span class="ident">test</span>)]</span>
-<span class="kw">mod</span> <span class="ident">tests</span> {
- <span class="kw">use</span> <span class="kw">super</span>::<span class="kw-2">*</span>;
-
- <span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">assert_match</span> {
- ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">x</span>:<span class="ident">expr</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">p</span>:<span class="ident">pat</span> ) <span class="op">=&gt;</span> {
- <span class="kw">match</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">x</span> {
- <span class="macro-nonterminal">$</span><span class="macro-nonterminal">p</span> <span class="op">=&gt;</span> (),
- <span class="kw">_</span> <span class="op">=&gt;</span> <span class="macro">panic</span><span class="macro">!</span>(<span class="string">&quot;Expression {} does not match pattern {}&quot;</span>, <span class="macro-nonterminal">$</span><span class="macro-nonterminal">x</span>, <span class="macro">stringify</span><span class="macro">!</span>(<span class="macro-nonterminal">$</span><span class="macro-nonterminal">p</span>)),
- }
- }
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">parse_basic_header</span>() {
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;Key: Value&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">key</span>, <span class="string">b&quot;Key&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_key</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;Key&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">value</span>, <span class="string">b&quot;Value&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;Value&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;Key : Value &quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">key</span>, <span class="string">b&quot;Key &quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">value</span>, <span class="string">b&quot;Value &quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;Value &quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;Key:&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">key</span>, <span class="string">b&quot;Key&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">value</span>, <span class="string">b&quot;&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;:\n&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">key</span>, <span class="string">b&quot;&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">value</span>, <span class="string">b&quot;&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;Key:Multi-line\n value&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">key</span>, <span class="string">b&quot;Key&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">value</span>, <span class="string">b&quot;Multi-line\n value&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;Multi-line value&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;Key: Multi\n line\n value\n&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">key</span>, <span class="string">b&quot;Key&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">value</span>, <span class="string">b&quot;Multi\n line\n value&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;Multi line value&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;Key: One\nKey2: Two&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">key</span>, <span class="string">b&quot;Key&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">value</span>, <span class="string">b&quot;One&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;Key: One\n\tOverhang&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">key</span>, <span class="string">b&quot;Key&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">value</span>, <span class="string">b&quot;One\n\tOverhang&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;One Overhang&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;SPAM: VIAGRA \xAE&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">key</span>, <span class="string">b&quot;SPAM&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">value</span>, <span class="string">b&quot;VIAGRA \xAE&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;VIAGRA \u{ae}&quot;</span>);
-
- <span class="ident">parse_header</span>(<span class="string">b&quot; Leading: Space&quot;</span>).<span class="ident">unwrap_err</span>();
- <span class="ident">parse_header</span>(<span class="string">b&quot;Just a string&quot;</span>).<span class="ident">unwrap_err</span>();
- <span class="ident">parse_header</span>(<span class="string">b&quot;Key\nBroken: Value&quot;</span>).<span class="ident">unwrap_err</span>();
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">parse_encoded_headers</span>() {
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;Subject: =?iso-8859-1?Q?=A1Hola,_se=F1or!?=&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_key</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;Subject&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;\u{a1}Hola, se\u{f1}or!&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(
- <span class="string">b&quot;Subject: =?iso-8859-1?Q?=A1Hola,?=\n \
- =?iso-8859-1?Q?_se=F1or!?=&quot;</span>,
- ).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_key</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;Subject&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;\u{a1}Hola, se\u{f1}or!&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;Euro: =?utf-8?Q?=E2=82=AC?=&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_key</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;Euro&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;\u{20ac}&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;HelloWorld: =?utf-8?B?aGVsbG8gd29ybGQ=?=&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;hello world&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;Empty: =?utf-8?Q??=&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;Incomplete: =?&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;=?&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;BadEncoding: =?garbage?Q??=&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;=?garbage?Q??=&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;Invalid: =?utf-8?Q?=E2=AC?=&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;\u{fffd}&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;LineBreak: =?utf-8?Q?=E2=82\n =AC?=&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;=?utf-8?Q?=E2=82 =AC?=&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;NotSeparateWord: hello=?utf-8?Q?world?=&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;hello=?utf-8?Q?world?=&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;NotSeparateWord2: =?utf-8?Q?hello?=world&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;=?utf-8?Q?hello?=world&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;Key: \&quot;=?utf-8?Q?value?=\&quot;&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;\&quot;value\&quot;&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(<span class="string">b&quot;Subject: =?utf-8?q?=5BOntario_Builder=5D_Understanding_home_shopping_=E2=80=93_a_q?=\n \
- =?utf-8?q?uick_survey?=&quot;</span>)
- .<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_key</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;Subject&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(),
- <span class="string">&quot;[Ontario Builder] Understanding home shopping \u{2013} a quick survey&quot;</span>
- );
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(
- <span class="string">b&quot;Content-Type: image/jpeg; name=\&quot;=?UTF-8?B?MDY2MTM5ODEuanBn?=\&quot;&quot;</span>,
- ).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_key</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;Content-Type&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(),
- <span class="string">&quot;image/jpeg; name=\&quot;06613981.jpg\&quot;&quot;</span>
- );
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_header</span>(
- <span class="string">b&quot;From: =?UTF-8?Q?\&quot;Motorola_Owners=E2=80=99_Forums\&quot;_?=&lt;forums@motorola.com&gt;&quot;</span>,
- ).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_key</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;From&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>(),
- <span class="string">&quot;\&quot;Motorola Owners\u{2019} Forums\&quot; &lt;forums@motorola.com&gt;&quot;</span>
- );
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">parse_multiple_headers</span>() {
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_headers</span>(<span class="string">b&quot;Key: Value\nTwo: Second&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>[<span class="number">0</span>].<span class="ident">key</span>, <span class="string">b&quot;Key&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>[<span class="number">0</span>].<span class="ident">value</span>, <span class="string">b&quot;Value&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>[<span class="number">1</span>].<span class="ident">key</span>, <span class="string">b&quot;Two&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>[<span class="number">1</span>].<span class="ident">value</span>, <span class="string">b&quot;Second&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_headers</span>(<span class="string">b&quot;Key: Value\n Overhang\nTwo: Second\nThree: Third&quot;</span>)
- .<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">len</span>(), <span class="number">3</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>[<span class="number">0</span>].<span class="ident">key</span>, <span class="string">b&quot;Key&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>[<span class="number">0</span>].<span class="ident">value</span>, <span class="string">b&quot;Value\n Overhang&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>[<span class="number">1</span>].<span class="ident">key</span>, <span class="string">b&quot;Two&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>[<span class="number">1</span>].<span class="ident">value</span>, <span class="string">b&quot;Second&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>[<span class="number">2</span>].<span class="ident">key</span>, <span class="string">b&quot;Three&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>[<span class="number">2</span>].<span class="ident">value</span>, <span class="string">b&quot;Third&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_headers</span>(<span class="string">b&quot;Key: Value\nTwo: Second\n\nBody&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>[<span class="number">0</span>].<span class="ident">key</span>, <span class="string">b&quot;Key&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>[<span class="number">0</span>].<span class="ident">value</span>, <span class="string">b&quot;Value&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>[<span class="number">1</span>].<span class="ident">key</span>, <span class="string">b&quot;Two&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>[<span class="number">1</span>].<span class="ident">value</span>, <span class="string">b&quot;Second&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_headers</span>(
- <span class="macro">concat</span><span class="macro">!</span>(
- <span class="string">&quot;Return-Path: &lt;kats@foobar.staktrace.com&gt;\n&quot;</span>,
- <span class="string">&quot;X-Original-To: kats@baz.staktrace.com\n&quot;</span>,
- <span class="string">&quot;Delivered-To: kats@baz.staktrace.com\n&quot;</span>,
- <span class="string">&quot;Received: from foobar.staktrace.com (localhost [127.0.0.1])\n&quot;</span>,
- <span class="string">&quot; by foobar.staktrace.com (Postfix) with ESMTP id \
- 139F711C1C34\n&quot;</span>,
- <span class="string">&quot; for &lt;kats@baz.staktrace.com&gt;; Fri, 27 May 2016 02:34:26 \
- -0400 (EDT)\n&quot;</span>,
- <span class="string">&quot;Date: Fri, 27 May 2016 02:34:25 -0400\n&quot;</span>,
- <span class="string">&quot;To: kats@baz.staktrace.com\n&quot;</span>,
- <span class="string">&quot;From: kats@foobar.staktrace.com\n&quot;</span>,
- <span class="string">&quot;Subject: test Fri, 27 May 2016 02:34:25 -0400\n&quot;</span>,
- <span class="string">&quot;X-Mailer: swaks v20130209.0 jetmore.org/john/code/swaks/\n&quot;</span>,
- <span class="string">&quot;Message-Id: \
- &lt;20160527063426.139F711C1C34@foobar.staktrace.com&gt;\n&quot;</span>,
- <span class="string">&quot;\n&quot;</span>,
- <span class="string">&quot;This is a test mailing\n&quot;</span>
- ).<span class="ident">as_bytes</span>(),
- ).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">len</span>(), <span class="number">10</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>[<span class="number">0</span>].<span class="ident">key</span>, <span class="string">b&quot;Return-Path&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>[<span class="number">9</span>].<span class="ident">key</span>, <span class="string">b&quot;Message-Id&quot;</span>);
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_headers</span>(
- <span class="string">b&quot;Key: Value\nAnotherKey: AnotherValue\nKey: Value2\nKey: Value3\n&quot;</span>,
- ).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">len</span>(), <span class="number">4</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">parsed</span>.<span class="ident">get_first_value</span>(<span class="string">&quot;Key&quot;</span>).<span class="ident">unwrap</span>(),
- <span class="prelude-val">Some</span>(<span class="string">&quot;Value&quot;</span>.<span class="ident">to_string</span>())
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">parsed</span>.<span class="ident">get_all_values</span>(<span class="string">&quot;Key&quot;</span>).<span class="ident">unwrap</span>(),
- <span class="macro">vec</span><span class="macro">!</span>[<span class="string">&quot;Value&quot;</span>, <span class="string">&quot;Value2&quot;</span>, <span class="string">&quot;Value3&quot;</span>]
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">parsed</span>.<span class="ident">get_first_value</span>(<span class="string">&quot;AnotherKey&quot;</span>).<span class="ident">unwrap</span>(),
- <span class="prelude-val">Some</span>(<span class="string">&quot;AnotherValue&quot;</span>.<span class="ident">to_string</span>())
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">parsed</span>.<span class="ident">get_all_values</span>(<span class="string">&quot;AnotherKey&quot;</span>).<span class="ident">unwrap</span>(),
- <span class="macro">vec</span><span class="macro">!</span>[<span class="string">&quot;AnotherValue&quot;</span>]
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_first_value</span>(<span class="string">&quot;NoKey&quot;</span>).<span class="ident">unwrap</span>(), <span class="prelude-val">None</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">parsed</span>.<span class="ident">get_all_values</span>(<span class="string">&quot;NoKey&quot;</span>).<span class="ident">unwrap</span>(),
- <span class="ident">Vec</span>::<span class="op">&lt;</span><span class="ident">String</span><span class="op">&gt;</span>::<span class="ident">new</span>()
- );
-
- <span class="kw">let</span> (<span class="ident">parsed</span>, <span class="kw">_</span>) <span class="op">=</span> <span class="ident">parse_headers</span>(<span class="string">b&quot;Key: value\r\nWith: CRLF\r\n\r\nBody&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">parsed</span>.<span class="ident">get_first_value</span>(<span class="string">&quot;Key&quot;</span>).<span class="ident">unwrap</span>(),
- <span class="prelude-val">Some</span>(<span class="string">&quot;value&quot;</span>.<span class="ident">to_string</span>())
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(
- <span class="ident">parsed</span>.<span class="ident">get_first_value</span>(<span class="string">&quot;With&quot;</span>).<span class="ident">unwrap</span>(),
- <span class="prelude-val">Some</span>(<span class="string">&quot;CRLF&quot;</span>.<span class="ident">to_string</span>())
- );
-
- <span class="macro">assert_match</span><span class="macro">!</span>(<span class="ident">parse_headers</span>(<span class="string">b&quot;Bad\nKey&quot;</span>).<span class="ident">unwrap_err</span>(), <span class="ident">MailParseError</span>::<span class="ident">Generic</span>(<span class="kw">_</span>));
- <span class="macro">assert_match</span><span class="macro">!</span>(<span class="ident">parse_headers</span>(<span class="string">b&quot;K:V\nBad\nKey&quot;</span>).<span class="ident">unwrap_err</span>(), <span class="ident">MailParseError</span>::<span class="ident">Generic</span>(<span class="kw">_</span>));
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_parse_content_type</span>() {
- <span class="kw">let</span> <span class="ident">ctype</span> <span class="op">=</span> <span class="ident">parse_content_type</span>(<span class="string">&quot;text/html; charset=utf-8&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">mimetype</span>, <span class="string">&quot;text/html&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">charset</span>, <span class="string">&quot;utf-8&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;boundary&quot;</span>), <span class="prelude-val">None</span>);
-
- <span class="kw">let</span> <span class="ident">ctype</span> <span class="op">=</span> <span class="ident">parse_content_type</span>(<span class="string">&quot; foo/bar; x=y; charset=\&quot;fake\&quot; ; x2=y2&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">mimetype</span>, <span class="string">&quot;foo/bar&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">charset</span>, <span class="string">&quot;fake&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;boundary&quot;</span>), <span class="prelude-val">None</span>);
-
- <span class="kw">let</span> <span class="ident">ctype</span> <span class="op">=</span> <span class="ident">parse_content_type</span>(<span class="string">&quot; multipart/bar; boundary=foo &quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">mimetype</span>, <span class="string">&quot;multipart/bar&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">charset</span>, <span class="string">&quot;us-ascii&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;boundary&quot;</span>).<span class="ident">unwrap</span>(), <span class="string">&quot;foo&quot;</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_parse_content_disposition</span>() {
- <span class="kw">let</span> <span class="ident">dis</span> <span class="op">=</span> <span class="ident">parse_content_disposition</span>(<span class="string">&quot;inline&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dis</span>.<span class="ident">disposition</span>, <span class="ident">DispositionType</span>::<span class="ident">Inline</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dis</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;name&quot;</span>), <span class="prelude-val">None</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dis</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;filename&quot;</span>), <span class="prelude-val">None</span>);
-
- <span class="kw">let</span> <span class="ident">dis</span> <span class="op">=</span> <span class="ident">parse_content_disposition</span>(
- <span class="string">&quot; attachment; x=y; charset=\&quot;fake\&quot; ; x2=y2; name=\&quot;King Joffrey.death\&quot;&quot;</span>,
- );
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dis</span>.<span class="ident">disposition</span>, <span class="ident">DispositionType</span>::<span class="ident">Attachment</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dis</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;name&quot;</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="string">&quot;King Joffrey.death&quot;</span>.<span class="ident">to_string</span>()));
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dis</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;filename&quot;</span>), <span class="prelude-val">None</span>);
-
- <span class="kw">let</span> <span class="ident">dis</span> <span class="op">=</span> <span class="ident">parse_content_disposition</span>(<span class="string">&quot; form-data&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dis</span>.<span class="ident">disposition</span>, <span class="ident">DispositionType</span>::<span class="ident">FormData</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dis</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;name&quot;</span>), <span class="prelude-val">None</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">dis</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;filename&quot;</span>), <span class="prelude-val">None</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_parse_mail</span>() {
- <span class="kw">let</span> <span class="ident">mail</span> <span class="op">=</span> <span class="ident">parse_mail</span>(<span class="string">b&quot;Key: value\r\n\r\nSome body stuffs&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">headers</span>.<span class="ident">len</span>(), <span class="number">1</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">headers</span>[<span class="number">0</span>].<span class="ident">get_key</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;Key&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">headers</span>[<span class="number">0</span>].<span class="ident">get_value</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;value&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">ctype</span>.<span class="ident">mimetype</span>, <span class="string">&quot;text/plain&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">ctype</span>.<span class="ident">charset</span>, <span class="string">&quot;us-ascii&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">ctype</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;boundary&quot;</span>), <span class="prelude-val">None</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">body</span>, <span class="string">b&quot;Some body stuffs&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">get_body_raw</span>().<span class="ident">unwrap</span>(), <span class="string">b&quot;Some body stuffs&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">get_body</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;Some body stuffs&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">subparts</span>.<span class="ident">len</span>(), <span class="number">0</span>);
-
- <span class="kw">let</span> <span class="ident">mail</span> <span class="op">=</span> <span class="ident">parse_mail</span>(
- <span class="macro">concat</span><span class="macro">!</span>(
- <span class="string">&quot;Content-Type: MULTIpart/alternative; bounDAry=myboundary\r\n\r\n&quot;</span>,
- <span class="string">&quot;--myboundary\r\n&quot;</span>,
- <span class="string">&quot;Content-Type: text/plain\r\n\r\n&quot;</span>,
- <span class="string">&quot;This is the plaintext version.\r\n&quot;</span>,
- <span class="string">&quot;--myboundary\r\n&quot;</span>,
- <span class="string">&quot;Content-Type: text/html;chARset=utf-8\r\n\r\n&quot;</span>,
- <span class="string">&quot;This is the &lt;b&gt;HTML&lt;/b&gt; version with fake --MYBOUNDARY.\r\n&quot;</span>,
- <span class="string">&quot;--myboundary--&quot;</span>).<span class="ident">as_bytes</span>(),
- ).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">headers</span>.<span class="ident">len</span>(), <span class="number">1</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">headers</span>[<span class="number">0</span>].<span class="ident">get_key</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;Content-Type&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">ctype</span>.<span class="ident">mimetype</span>, <span class="string">&quot;multipart/alternative&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">ctype</span>.<span class="ident">charset</span>, <span class="string">&quot;us-ascii&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">ctype</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;boundary&quot;</span>).<span class="ident">unwrap</span>(), <span class="string">&quot;myboundary&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">subparts</span>.<span class="ident">len</span>(), <span class="number">2</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">subparts</span>[<span class="number">0</span>].<span class="ident">headers</span>.<span class="ident">len</span>(), <span class="number">1</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">subparts</span>[<span class="number">0</span>].<span class="ident">ctype</span>.<span class="ident">mimetype</span>, <span class="string">&quot;text/plain&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">subparts</span>[<span class="number">0</span>].<span class="ident">ctype</span>.<span class="ident">charset</span>, <span class="string">&quot;us-ascii&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">subparts</span>[<span class="number">0</span>].<span class="ident">ctype</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;boundary&quot;</span>), <span class="prelude-val">None</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">subparts</span>[<span class="number">1</span>].<span class="ident">ctype</span>.<span class="ident">mimetype</span>, <span class="string">&quot;text/html&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">subparts</span>[<span class="number">1</span>].<span class="ident">ctype</span>.<span class="ident">charset</span>, <span class="string">&quot;utf-8&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">subparts</span>[<span class="number">1</span>].<span class="ident">ctype</span>.<span class="ident">params</span>.<span class="ident">get</span>(<span class="string">&quot;boundary&quot;</span>), <span class="prelude-val">None</span>);
-
- <span class="kw">let</span> <span class="ident">mail</span> <span class="op">=</span> <span class="ident">parse_mail</span>(
- <span class="string">b&quot;Content-Transfer-Encoding: base64\r\n\r\naGVsbG 8gd\r\n29ybGQ=&quot;</span>,
- ).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">get_body_raw</span>().<span class="ident">unwrap</span>(), <span class="string">b&quot;hello world&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">get_body</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;hello world&quot;</span>);
-
- <span class="kw">let</span> <span class="ident">mail</span> <span class="op">=</span> <span class="ident">parse_mail</span>(
- <span class="string">b&quot;Content-Type: text/plain; charset=x-unknown\r\n\r\nhello world&quot;</span>,
- ).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">get_body_raw</span>().<span class="ident">unwrap</span>(), <span class="string">b&quot;hello world&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">get_body</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;hello world&quot;</span>);
-
- <span class="kw">let</span> <span class="ident">mail</span> <span class="op">=</span> <span class="ident">parse_mail</span>(<span class="string">b&quot;ConTENT-tyPE: text/html\r\n\r\nhello world&quot;</span>).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">ctype</span>.<span class="ident">mimetype</span>, <span class="string">&quot;text/html&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">get_body_raw</span>().<span class="ident">unwrap</span>(), <span class="string">b&quot;hello world&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">get_body</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;hello world&quot;</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_missing_terminating_boundary</span>() {
- <span class="kw">let</span> <span class="ident">mail</span> <span class="op">=</span> <span class="ident">parse_mail</span>(
- <span class="macro">concat</span><span class="macro">!</span>(
- <span class="string">&quot;Content-Type: multipart/alternative; boundary=myboundary\r\n\r\n&quot;</span>,
- <span class="string">&quot;--myboundary\r\n&quot;</span>,
- <span class="string">&quot;Content-Type: text/plain\r\n\r\n&quot;</span>,
- <span class="string">&quot;part0\r\n&quot;</span>,
- <span class="string">&quot;--myboundary\r\n&quot;</span>,
- <span class="string">&quot;Content-Type: text/html\r\n\r\n&quot;</span>,
- <span class="string">&quot;part1\r\n&quot;</span>).<span class="ident">as_bytes</span>(),
- ).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">subparts</span>[<span class="number">0</span>].<span class="ident">get_body</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;part0\r\n&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">subparts</span>[<span class="number">1</span>].<span class="ident">get_body</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;part1\r\n&quot;</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_missing_body</span>() {
- <span class="kw">let</span> <span class="ident">parsed</span> <span class="op">=</span> <span class="ident">parse_mail</span>(
- <span class="string">&quot;Content-Type: multipart/related; boundary=\&quot;----=_\&quot;\n&quot;</span>.<span class="ident">as_bytes</span>(),
- ).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">headers</span>[<span class="number">0</span>].<span class="ident">get_key</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;Content-Type&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_body_raw</span>().<span class="ident">unwrap</span>(), <span class="string">b&quot;&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">parsed</span>.<span class="ident">get_body</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;&quot;</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_no_headers_in_subpart</span>() {
- <span class="kw">let</span> <span class="ident">mail</span> <span class="op">=</span> <span class="ident">parse_mail</span>(
- <span class="macro">concat</span><span class="macro">!</span>(
- <span class="string">&quot;Content-Type: multipart/report; report-type=delivery-status;\n&quot;</span>,
- <span class="string">&quot;\tboundary=\&quot;1404630116.22555.postech.q0.x.x.x\&quot;\n&quot;</span>,
- <span class="string">&quot;\n&quot;</span>,
- <span class="string">&quot;--1404630116.22555.postech.q0.x.x.x\n&quot;</span>,
- <span class="string">&quot;\n&quot;</span>,
- <span class="string">&quot;--1404630116.22555.postech.q0.x.x.x--\n&quot;</span>).<span class="ident">as_bytes</span>(),
- ).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">ctype</span>.<span class="ident">mimetype</span>, <span class="string">&quot;multipart/report&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">subparts</span>[<span class="number">0</span>].<span class="ident">headers</span>.<span class="ident">len</span>(), <span class="number">0</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">subparts</span>[<span class="number">0</span>].<span class="ident">ctype</span>.<span class="ident">mimetype</span>, <span class="string">&quot;text/plain&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">subparts</span>[<span class="number">0</span>].<span class="ident">get_body_raw</span>().<span class="ident">unwrap</span>(), <span class="string">b&quot;&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">subparts</span>[<span class="number">0</span>].<span class="ident">get_body</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;&quot;</span>);
- }
-
- <span class="attribute">#[<span class="ident">test</span>]</span>
- <span class="kw">fn</span> <span class="ident">test_empty</span>() {
- <span class="kw">let</span> <span class="ident">mail</span> <span class="op">=</span> <span class="ident">parse_mail</span>(<span class="string">&quot;&quot;</span>.<span class="ident">as_bytes</span>()).<span class="ident">unwrap</span>();
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">get_body_raw</span>().<span class="ident">unwrap</span>(), <span class="string">b&quot;&quot;</span>);
- <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">mail</span>.<span class="ident">get_body</span>().<span class="ident">unwrap</span>(), <span class="string">&quot;&quot;</span>);
- }
-}
-</pre>
-</section>
- <section id='search' class="content hidden"></section>
-
- <section class="footer"></section>
-
- <aside id="help" class="hidden">
- <div>
- <h1 class="hidden">Help</h1>
-
- <div class="shortcuts">
- <h2>Keyboard Shortcuts</h2>
-
- <dl>
- <dt><kbd>?</kbd></dt>
- <dd>Show this help dialog</dd>
- <dt><kbd>S</kbd></dt>
- <dd>Focus the search field</dd>
- <dt><kbd>↑</kbd></dt>
- <dd>Move up in search results</dd>
- <dt><kbd>↓</kbd></dt>
- <dd>Move down in search results</dd>
- <dt><kbd>↹</kbd></dt>
- <dd>Switch tab</dd>
- <dt><kbd>&#9166;</kbd></dt>
- <dd>Go to active search result</dd>
- <dt><kbd>+</kbd></dt>
- <dd>Expand all sections</dd>
- <dt><kbd>-</kbd></dt>
- <dd>Collapse all sections</dd>
- </dl>
- </div>
-
- <div class="infos">
- <h2>Search Tricks</h2>
-
- <p>
- Prefix searches with a type followed by a colon (e.g.
- <code>fn:</code>) to restrict the search to a given type.
- </p>
-
- <p>
- Accepted types are: <code>fn</code>, <code>mod</code>,
- <code>struct</code>, <code>enum</code>,
- <code>trait</code>, <code>type</code>, <code>macro</code>,
- and <code>const</code>.
- </p>
-
- <p>
- Search functions by type signature (e.g.
- <code>vec -> usize</code> or <code>* -> vec</code>)
- </p>
- </div>
- </div>
- </aside>
-
-
-
- <script>
- window.rootPath = "../../";
- window.currentCrate = "mailparse";
- </script>
- <script src="../../main.js"></script>
- <script defer src="../../search-index.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/src/mailparse/macros.rs.html b/target/doc/src/mailparse/macros.rs.html
deleted file mode 100644
index 22d3d4c..0000000
--- a/target/doc/src/mailparse/macros.rs.html
+++ /dev/null
@@ -1,140 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="generator" content="rustdoc">
- <meta name="description" content="Source to the Rust file `src/macros.rs`.">
- <meta name="keywords" content="rust, rustlang, rust-lang">
-
- <title>macros.rs.html -- source</title>
-
- <link rel="stylesheet" type="text/css" href="../../normalize.css">
- <link rel="stylesheet" type="text/css" href="../../rustdoc.css"
- id="mainThemeStyle">
-
- <link rel="stylesheet" type="text/css" href="../../dark.css">
- <link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle">
- <script src="../../storage.js"></script>
-
-
-
-
-</head>
-<body class="rustdoc source">
- <!--[if lte IE 8]>
- <div class="warning">
- This old browser is unsupported and will most likely display funky
- things.
- </div>
- <![endif]-->
-
-
-
- <nav class="sidebar">
- <div class="sidebar-menu">&#9776;</div>
-
-
- </nav>
-
- <div class="theme-picker">
- <button id="theme-picker" aria-label="Pick another theme!">
- <img src="../../brush.svg" width="18" alt="Pick another theme!">
- </button>
- <div id="theme-choices"></div>
- </div>
- <script src="../../theme.js"></script>
- <nav class="sub">
- <form class="search-form js-only">
- <div class="search-container">
- <input class="search-input" name="search"
- autocomplete="off"
- placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
- type="search">
- </div>
- </form>
- </nav>
-
- <section id='main' class="content"><pre class="line-numbers"><span id="1">1</span>
-<span id="2">2</span>
-<span id="3">3</span>
-<span id="4">4</span>
-<span id="5">5</span>
-<span id="6">6</span>
-<span id="7">7</span>
-<span id="8">8</span>
-</pre><pre class="rust ">
-<span class="macro">macro_rules</span><span class="macro">!</span> <span class="ident">try_none</span> {
- ( <span class="macro-nonterminal">$</span><span class="macro-nonterminal">x</span>:<span class="ident">expr</span> ) <span class="op">=&gt;</span> {{
- <span class="kw">match</span> <span class="macro-nonterminal">$</span><span class="macro-nonterminal">x</span> {
- <span class="prelude-val">Some</span>(<span class="ident">v</span>) <span class="op">=&gt;</span> <span class="ident">v</span>,
- <span class="prelude-val">None</span> <span class="op">=&gt;</span> <span class="kw">return</span> <span class="prelude-val">None</span>,
- }
- }}
-}
-</pre>
-</section>
- <section id='search' class="content hidden"></section>
-
- <section class="footer"></section>
-
- <aside id="help" class="hidden">
- <div>
- <h1 class="hidden">Help</h1>
-
- <div class="shortcuts">
- <h2>Keyboard Shortcuts</h2>
-
- <dl>
- <dt><kbd>?</kbd></dt>
- <dd>Show this help dialog</dd>
- <dt><kbd>S</kbd></dt>
- <dd>Focus the search field</dd>
- <dt><kbd>↑</kbd></dt>
- <dd>Move up in search results</dd>
- <dt><kbd>↓</kbd></dt>
- <dd>Move down in search results</dd>
- <dt><kbd>↹</kbd></dt>
- <dd>Switch tab</dd>
- <dt><kbd>&#9166;</kbd></dt>
- <dd>Go to active search result</dd>
- <dt><kbd>+</kbd></dt>
- <dd>Expand all sections</dd>
- <dt><kbd>-</kbd></dt>
- <dd>Collapse all sections</dd>
- </dl>
- </div>
-
- <div class="infos">
- <h2>Search Tricks</h2>
-
- <p>
- Prefix searches with a type followed by a colon (e.g.
- <code>fn:</code>) to restrict the search to a given type.
- </p>
-
- <p>
- Accepted types are: <code>fn</code>, <code>mod</code>,
- <code>struct</code>, <code>enum</code>,
- <code>trait</code>, <code>type</code>, <code>macro</code>,
- and <code>const</code>.
- </p>
-
- <p>
- Search functions by type signature (e.g.
- <code>vec -> usize</code> or <code>* -> vec</code>)
- </p>
- </div>
- </div>
- </aside>
-
-
-
- <script>
- window.rootPath = "../../";
- window.currentCrate = "mailparse";
- </script>
- <script src="../../main.js"></script>
- <script defer src="../../search-index.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/target/doc/storage.js b/target/doc/storage.js
deleted file mode 100644
index 09511fa..0000000
--- a/target/doc/storage.js
+++ /dev/null
@@ -1,71 +0,0 @@
-var resourcesSuffix = "";
-/*!
- * Copyright 2018 The Rust Project Developers. See the COPYRIGHT
- * file at the top-level directory of this distribution and at
- * http://rust-lang.org/COPYRIGHT.
- *
- * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
- * http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
- * <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
- * option. This file may not be copied, modified, or distributed
- * except according to those terms.
- */
-
-var currentTheme = document.getElementById("themeStyle");
-var mainTheme = document.getElementById("mainThemeStyle");
-
-var savedHref = [];
-
-function onEach(arr, func) {
- if (arr && arr.length > 0 && func) {
- for (var i = 0; i < arr.length; i++) {
- if (func(arr[i]) === true) {
- break;
- }
- }
- }
-}
-
-function updateLocalStorage(name, value) {
- if (typeof(Storage) !== "undefined") {
- localStorage[name] = value;
- } else {
- // No Web Storage support so we do nothing
- }
-}
-
-function getCurrentValue(name) {
- if (typeof(Storage) !== "undefined" && localStorage[name] !== undefined) {
- return localStorage[name];
- }
- return null;
-}
-
-function switchTheme(styleElem, mainStyleElem, newTheme) {
- var fullBasicCss = "rustdoc" + resourcesSuffix + ".css";
- var fullNewTheme = newTheme + resourcesSuffix + ".css";
- var newHref = mainStyleElem.href.replace(fullBasicCss, fullNewTheme);
-
- if (styleElem.href === newHref) {
- return;
- }
-
- var found = false;
- if (savedHref.length === 0) {
- onEach(document.getElementsByTagName("link"), function(el) {
- savedHref.push(el.href);
- });
- }
- onEach(savedHref, function(el) {
- if (el === newHref) {
- found = true;
- return true;
- }
- });
- if (found === true) {
- styleElem.href = newHref;
- updateLocalStorage('rustdoc-theme', newTheme);
- }
-}
-
-switchTheme(currentTheme, mainTheme, getCurrentValue('rustdoc-theme') || 'light');
diff --git a/target/doc/theme.js b/target/doc/theme.js
deleted file mode 100644
index 3e7a5be..0000000
--- a/target/doc/theme.js
+++ /dev/null
@@ -1,21 +0,0 @@
-var themes = document.getElementById("theme-choices");
-var themePicker = document.getElementById("theme-picker");
-themePicker.onclick = function() {
- if (themes.style.display === "block") {
- themes.style.display = "none";
- themePicker.style.borderBottomRightRadius = "3px";
- themePicker.style.borderBottomLeftRadius = "3px";
- } else {
- themes.style.display = "block";
- themePicker.style.borderBottomRightRadius = "0";
- themePicker.style.borderBottomLeftRadius = "0";
- }
-};
-["dark","light"].forEach(function(item) {
- var but = document.createElement('button');
- but.innerHTML = item;
- but.onclick = function(el) {
- switchTheme(currentTheme, mainTheme, item);
- };
- themes.appendChild(but);
-});