diff options
Diffstat (limited to 'target/doc/mailparse/fn.parse_content_type.html')
-rw-r--r-- | target/doc/mailparse/fn.parse_content_type.html | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/target/doc/mailparse/fn.parse_content_type.html b/target/doc/mailparse/fn.parse_content_type.html index f76083b..b60539e 100644 --- a/target/doc/mailparse/fn.parse_content_type.html +++ b/target/doc/mailparse/fn.parse_content_type.html @@ -10,10 +10,11 @@ <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="../rustdoc.css" + id="mainThemeStyle"> <link rel="stylesheet" type="text/css" href="../dark.css"> - <link rel="stylesheet" type="text/css" href="../main.css" id="themeStyle"> + <link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"> <script src="../storage.js"></script> @@ -33,7 +34,7 @@ <nav class="sidebar"> <div class="sidebar-menu">☰</div> - <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 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"> @@ -54,13 +55,11 @@ </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'> + <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'>−</span>] </a> - </span><a class='srclink' href='../src/mailparse/lib.rs.html#551-563' title='goto source code'>[src]</a></span></h1> -<pre class='rust fn'>pub fn parse_content_type(header: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <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 + </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: &<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -> <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 @@ -68,7 +67,7 @@ charset - either the one explicitly specified or the default of "us-ascii&q <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="op">=</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"Content-Type: text/html; charset=foo; boundary=\"quotes_are_removed\""</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">&</span><span class="ident">parsed</span>.<span class="ident">get_value</span>().<span class="ident">unwrap</span>()); @@ -79,7 +78,7 @@ charset - either the one explicitly specified or the default of "us-ascii&q <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="op">=</span> <span class="ident">parse_header</span>(<span class="string">b"Content-Type: bogus"</span>).<span class="ident">unwrap</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"Content-Type: bogus"</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">&</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">"bogus"</span>); <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">charset</span>, <span class="string">"us-ascii"</span>); @@ -88,7 +87,7 @@ charset - either the one explicitly specified or the default of "us-ascii&q <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="op">=</span> <span class="ident">parse_header</span>(<span class="string">br#"Content-Type: application/octet-stream;name="=?utf8?B?6L+O5ai255m95a+M576O?=";charset="utf8""#</span>).<span class="ident">unwrap</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#"Content-Type: application/octet-stream;name="=?utf8?B?6L+O5ai255m95a+M576O?=";charset="utf8""#</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">&</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">"application/octet-stream"</span>); <span class="macro">assert_eq</span><span class="macro">!</span>(<span class="ident">ctype</span>.<span class="ident">charset</span>, <span class="string">"utf8"</span>); |