trash_parallelism 0.1.102

Azzybana Raccoon's comprehensive parallelism library.
Documentation
<!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="Parses key-value pairs from a string content, typically from config files."><title>parse_key_value in trash_utilities::data - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-ca0dd0c4.css"><script id="default-settings" 
data-use_system_theme="false"
data-theme="trash"></script><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="trash_utilities" data-themes="trash" data-resource-suffix="" data-rustdoc-version="1.92.0-nightly (b925a865e 2025-10-09)" data-channel="nightly" data-search-js="search-8d3311b9.js" data-stringdex-js="stringdex-828709d0.js" data-settings-js="settings-c38705f0.js" ><script src="../../static.files/storage-e2aeef58.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-ce535bd0.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-263c88ec.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">parse_key_value</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><a class="logo-container" href="../../trash_utilities/index.html"><img src="https://avatars.githubusercontent.com/u/121582001?v=4&#38;size=64" alt="logo"></a><h2><a href="../../trash_utilities/index.html">trash_<wbr>utilities</a><span class="version">0.1.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">parse_<wbr>key_<wbr>value</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#parameters" title="Parameters">Parameters</a></li><li><a href="#returns" title="Returns">Returns</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In trash_<wbr>utilities::<wbr>data</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">trash_utilities</a>::<wbr><a href="index.html">data</a></div><h1>Function <span class="fn">parse_<wbr>key_<wbr>value</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/trash_utilities/data.rs.html#36-46">Source</a> </span></div><pre class="rust item-decl"><code>pub fn parse_key_value(content: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; AHashMap&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></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Parses key-value pairs from a string content, typically from config files.</p>
<p>This function assumes each line is in the format “key=value”. It uses <code>memchr</code>
for efficient byte-level searching of the ‘=’ character. Lines without ‘=’ are ignored.</p>
<h2 id="parameters"><a class="doc-anchor" href="#parameters">§</a>Parameters</h2>
<ul>
<li><code>content</code>: The string content to parse.</li>
</ul>
<h2 id="returns"><a class="doc-anchor" href="#returns">§</a>Returns</h2>
<p>An <code>AHashMap&lt;String, String&gt;</code> containing the parsed key-value pairs.
Keys and values are trimmed of whitespace.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>trash_analyzer::base::data::parse_key_value;
<span class="kw">use </span>ahash::AHashMap;

<span class="kw">let </span>content = <span class="string">"name=John\nage=30\ncity=New York"</span>;
<span class="kw">let </span>map = parse_key_value(content);
<span class="macro">assert_eq!</span>(map.get(<span class="string">"name"</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="string">"John"</span>.to_string()));
<span class="macro">assert_eq!</span>(map.get(<span class="string">"age"</span>), <span class="prelude-val">Some</span>(<span class="kw-2">&amp;</span><span class="string">"30"</span>.to_string()));</code></pre><a class="test-arrow" target="_blank" title="Run code" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn+main()+%7B%0A++++use+trash_analyzer::base::data::parse_key_value;%0A++++use+ahash::AHashMap;%0A++++%0A++++let+content+=+%22name=John%5Cnage=30%5Cncity=New+York%22;%0A++++let+map+=+parse_key_value(content);%0A++++assert_eq!(map.get(%22name%22),+Some(%26%22John%22.to_string()));%0A++++assert_eq!(map.get(%22age%22),+Some(%26%2230%22.to_string()));%0A%7D&amp;edition=2024"></a></div></div></details></section></div></main></body></html>