summaryrefslogtreecommitdiffstats
path: root/target/doc/mailparse/index.html
blob: 5b6e8a4a364045ad0937e2d21f20c13940b59c89 (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
<!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="../rustdoc.css">
    <link rel="stylesheet" type="text/css" href="../main.css">
    

    
    
</head>
<body class="rustdoc">
    <!--[if lte IE 8]>
    <div class="warning">
        This old browser is unsupported and will most likely display funky
        things.
    </div>
    <![endif]-->

    

    <nav class="sidebar">
        
        <p class='location'></p><script>window.sidebarCurrent = {name: 'mailparse', ty: 'mod', relpath: '../'};</script>
    </nav>

    <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 mod">
<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 id='src-0' class='srclink' href='../src/mailparse/src/lib.rs.html#1-977' 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='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.ParsedContentType.html'
                                  title='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='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.MailParseError.html'
                                  title='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='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='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_type.html'
                                  title='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. The charset
defaults to &quot;us-ascii&quot; if no charset parameter is provided in the header
value.</p>
                           </td>
                       </tr>
                       <tr class=' module-item'>
                           <td><a class='fn' href='fn.parse_header.html'
                                  title='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='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='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>?</dt>
                    <dd>Show this help dialog</dd>
                    <dt>S</dt>
                    <dd>Focus the search field</dd>
                    <dt>&larrb;</dt>
                    <dd>Move up in search results</dd>
                    <dt>&rarrb;</dt>
                    <dd>Move down in search results</dd>
                    <dt>&#9166;</dt>
                    <dd>Go to active search result</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";
        window.playgroundUrl = "";
    </script>
    <script src="../jquery.js"></script>
    <script src="../main.js"></script>
    
    <script defer src="../search-index.js"></script>
</body>
</html>