summaryrefslogtreecommitdiffstats
path: root/target/doc/mailparse/index.html
blob: 9ec069bc42a11aacb1c472d879d52aa932d8f1a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
<!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=