diff options
Diffstat (limited to 'target/doc/mailparse/fn.parse_content_type.html')
-rw-r--r-- | target/doc/mailparse/fn.parse_content_type.html | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/target/doc/mailparse/fn.parse_content_type.html b/target/doc/mailparse/fn.parse_content_type.html index a6e1511..f76083b 100644 --- a/target/doc/mailparse/fn.parse_content_type.html +++ b/target/doc/mailparse/fn.parse_content_type.html @@ -10,8 +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"> - <link rel="stylesheet" type="text/css" href="../main.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="../main.css" id="themeStyle"> + <script src="../storage.js"></script> @@ -28,10 +31,18 @@ <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> </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"> @@ -48,16 +59,15 @@ <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#552-564' title='goto source code'>[src]</a></span></h1> + </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 -the returned object's <code>params</code> map will contain a charset key if a charset +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 "us-ascii".</p> - -<h1 id='examples' class='section-header'><a href='#examples'>Examples</a></h1> +<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">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: text/html; charset=foo; boundary=\"quotes_are_removed\""</span>) .<span class="ident">unwrap</span>(); @@ -68,7 +78,7 @@ charset - either the one explicitly specified or the default of "us-ascii&q <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">"charset"</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&</span><span class="string">"foo"</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">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">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>); @@ -77,7 +87,7 @@ charset - either the one explicitly specified or the default of "us-ascii&q <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">"charset"</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">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">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>); @@ -97,18 +107,22 @@ charset - either the one explicitly specified or the default of "us-ascii&q <h2>Keyboard Shortcuts</h2> <dl> - <dt>?</dt> + <dt><kbd>?</kbd></dt> <dd>Show this help dialog</dd> - <dt>S</dt> + <dt><kbd>S</kbd></dt> <dd>Focus the search field</dd> - <dt>⇤</dt> + <dt><kbd>↑</kbd></dt> <dd>Move up in search results</dd> - <dt>⇥</dt> + <dt><kbd>↓</kbd></dt> <dd>Move down in search results</dd> - <dt>⏎</dt> + <dt><kbd>↹</kbd></dt> + <dd>Switch tab</dd> + <dt><kbd>⏎</kbd></dt> <dd>Go to active search result</dd> - <dt>+</dt> - <dd>Collapse/expand all sections</dd> + <dt><kbd>+</kbd></dt> + <dd>Expand all sections</dd> + <dt><kbd>-</kbd></dt> + <dd>Collapse all sections</dd> </dl> </div> |