Adding large folders

This commit is contained in:
2026-02-26 12:00:21 -05:00
parent 5400d82acd
commit 49701c85ad
47332 changed files with 1942573 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,13 @@
<!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="Compare corresponding bytes in `x` and `y` for equality."><title>is_equal in memchr::arch::all - 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"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">is_equal</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">is_<wbr>equal</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#inlining" title="Inlining">Inlining</a></li><li><a href="#motivation" title="Motivation">Motivation</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In memchr::<wbr>arch::<wbr>all</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">memchr</a>::<wbr><a href="../index.html">arch</a>::<wbr><a href="index.html">all</a></div><h1>Function <span class="fn">is_<wbr>equal</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/memchr/arch/all/mod.rs.html#65-73">Source</a> </span></div><pre class="rust item-decl"><code>pub fn is_equal(x: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>], y: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Compare corresponding bytes in <code>x</code> and <code>y</code> for equality.</p>
<p>That is, this returns true if and only if <code>x.len() == y.len()</code> and
<code>x[i] == y[i]</code> for all <code>0 &lt;= i &lt; x.len()</code>.</p>
<h2 id="inlining"><a class="doc-anchor" href="#inlining">§</a>Inlining</h2>
<p>This routine is marked <code>inline(always)</code>. If you want to call this function
in a way that is not always inlined, youll need to wrap a call to it in
another function that is marked as <code>inline(never)</code> or just <code>inline</code>.</p>
<h2 id="motivation"><a class="doc-anchor" href="#motivation">§</a>Motivation</h2>
<p>Why not use slice equality instead? Well, slice equality usually results in
a call out to the current platforms <code>libc</code> which might not be inlineable
or have other overhead. This routine isnt guaranteed to be a win, but it
might be in some cases.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,28 @@
<!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="Compare `n` bytes at the given pointers for equality."><title>is_equal_raw in memchr::arch::all - 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"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">is_equal_raw</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">is_<wbr>equal_<wbr>raw</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#inlining" title="Inlining">Inlining</a></li><li><a href="#motivation" title="Motivation">Motivation</a></li><li><a href="#safety" title="Safety">Safety</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In memchr::<wbr>arch::<wbr>all</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">memchr</a>::<wbr><a href="../index.html">arch</a>::<wbr><a href="index.html">all</a></div><h1>Function <span class="fn">is_<wbr>equal_<wbr>raw</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/memchr/arch/all/mod.rs.html#108-158">Source</a> </span></div><pre class="rust item-decl"><code>pub unsafe fn is_equal_raw(x: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.pointer.html">*const </a><a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>, y: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.pointer.html">*const </a><a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>, n: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Compare <code>n</code> bytes at the given pointers for equality.</p>
<p>This returns true if and only if <code>*x.add(i) == *y.add(i)</code> for all
<code>0 &lt;= i &lt; n</code>.</p>
<h2 id="inlining"><a class="doc-anchor" href="#inlining">§</a>Inlining</h2>
<p>This routine is marked <code>inline(always)</code>. If you want to call this function
in a way that is not always inlined, youll need to wrap a call to it in
another function that is marked as <code>inline(never)</code> or just <code>inline</code>.</p>
<h2 id="motivation"><a class="doc-anchor" href="#motivation">§</a>Motivation</h2>
<p>Why not use slice equality instead? Well, slice equality usually results in
a call out to the current platforms <code>libc</code> which might not be inlineable
or have other overhead. This routine isnt guaranteed to be a win, but it
might be in some cases.</p>
<h2 id="safety"><a class="doc-anchor" href="#safety">§</a>Safety</h2>
<ul>
<li>Both <code>x</code> and <code>y</code> must be valid for reads of up to <code>n</code> bytes.</li>
<li>Both <code>x</code> and <code>y</code> must point to an initialized value.</li>
<li>Both <code>x</code> and <code>y</code> must each point to an allocated object and
must either be in bounds or at most one byte past the end of the
allocated object. <code>x</code> and <code>y</code> do not need to point to the same allocated
object, but they may.</li>
<li>Both <code>x</code> and <code>y</code> must be <em>derived from</em> a pointer to their respective
allocated objects.</li>
<li>The distance between <code>x</code> and <code>x+n</code> must not overflow <code>isize</code>. Similarly
for <code>y</code> and <code>y+n</code>.</li>
<li>The distance being in bounds must not rely on “wrapping around” the
address space.</li>
</ul>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,8 @@
<!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="Returns true if and only if `needle` is a prefix of `haystack`."><title>is_prefix in memchr::arch::all - 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"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">is_prefix</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">is_<wbr>prefix</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#inlining" title="Inlining">Inlining</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In memchr::<wbr>arch::<wbr>all</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">memchr</a>::<wbr><a href="../index.html">arch</a>::<wbr><a href="index.html">all</a></div><h1>Function <span class="fn">is_<wbr>prefix</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/memchr/arch/all/mod.rs.html#26-29">Source</a> </span></div><pre class="rust item-decl"><code>pub fn is_prefix(haystack: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>], needle: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns true if and only if <code>needle</code> is a prefix of <code>haystack</code>.</p>
<p>This uses a latency optimized variant of <code>memcmp</code> internally which <em>might</em>
make this faster for very short strings.</p>
<h2 id="inlining"><a class="doc-anchor" href="#inlining">§</a>Inlining</h2>
<p>This routine is marked <code>inline(always)</code>. If you want to call this function
in a way that is not always inlined, youll need to wrap a call to it in
another function that is marked as <code>inline(never)</code> or just <code>inline</code>.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,8 @@
<!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="Returns true if and only if `needle` is a suffix of `haystack`."><title>is_suffix in memchr::arch::all - 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"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">is_suffix</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">is_<wbr>suffix</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#inlining" title="Inlining">Inlining</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In memchr::<wbr>arch::<wbr>all</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">memchr</a>::<wbr><a href="../index.html">arch</a>::<wbr><a href="index.html">all</a></div><h1>Function <span class="fn">is_<wbr>suffix</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/memchr/arch/all/mod.rs.html#42-45">Source</a> </span></div><pre class="rust item-decl"><code>pub fn is_suffix(haystack: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>], needle: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.bool.html">bool</a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns true if and only if <code>needle</code> is a suffix of <code>haystack</code>.</p>
<p>This uses a latency optimized variant of <code>memcmp</code> internally which <em>might</em>
make this faster for very short strings.</p>
<h2 id="inlining"><a class="doc-anchor" href="#inlining">§</a>Inlining</h2>
<p>This routine is marked <code>inline(always)</code>. If you want to call this function
in a way that is not always inlined, youll need to wrap a call to it in
another function that is marked as <code>inline(never)</code> or just <code>inline</code>.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,5 @@
<!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="Contains architecture independent routines."><title>memchr::arch::all - 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"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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 mod"><!--[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="#">Module all</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module all</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In memchr::<wbr>arch</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">memchr</a>::<wbr><a href="../index.html">arch</a></div><h1>Module <span>all</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/memchr/arch/all/mod.rs.html#1-234">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Contains architecture independent routines.</p>
<p>These routines are often used as a “fallback” implementation when the more
specialized architecture dependent routines are unavailable.</p>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="memchr/index.html" title="mod memchr::arch::all::memchr">memchr</a></dt><dd>Provides architecture independent implementations of <code>memchr</code> and friends.</dd><dt><a class="mod" href="packedpair/index.html" title="mod memchr::arch::all::packedpair">packedpair</a></dt><dd>Provides an architecture independent implementation of the “packed pair”
algorithm.</dd><dt><a class="mod" href="rabinkarp/index.html" title="mod memchr::arch::all::rabinkarp">rabinkarp</a></dt><dd>An implementation of the <a href="https://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm">Rabin-Karp substring search algorithm</a>.</dd><dt><a class="mod" href="shiftor/index.html" title="mod memchr::arch::all::shiftor">shiftor</a></dt><dd>An implementation of the <a href="https://en.wikipedia.org/wiki/Bitap_algorithm">Shift-Or substring search algorithm</a>.</dd><dt><a class="mod" href="twoway/index.html" title="mod memchr::arch::all::twoway">twoway</a></dt><dd>An implementation of the <a href="https://en.wikipedia.org/wiki/Two-way_string-matching_algorithm">Two-Way substring search algorithm</a>.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.is_equal.html" title="fn memchr::arch::all::is_equal">is_<wbr>equal</a></dt><dd>Compare corresponding bytes in <code>x</code> and <code>y</code> for equality.</dd><dt><a class="fn" href="fn.is_equal_raw.html" title="fn memchr::arch::all::is_equal_raw">is_<wbr>equal_<wbr>raw</a><sup title="unsafe function"></sup></dt><dd>Compare <code>n</code> bytes at the given pointers for equality.</dd><dt><a class="fn" href="fn.is_prefix.html" title="fn memchr::arch::all::is_prefix">is_<wbr>prefix</a></dt><dd>Returns true if and only if <code>needle</code> is a prefix of <code>haystack</code>.</dd><dt><a class="fn" href="fn.is_suffix.html" title="fn memchr::arch::all::is_suffix">is_<wbr>suffix</a></dt><dd>Returns true if and only if <code>needle</code> is a suffix of <code>haystack</code>.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1,20 @@
<!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="Provides architecture independent implementations of `memchr` and friends."><title>memchr::arch::all::memchr - 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"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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 mod"><!--[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="#">Module memchr</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module memchr</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In memchr::<wbr>arch::<wbr>all</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">memchr</a>::<wbr><a href="../../index.html">arch</a>::<wbr><a href="../index.html">all</a></div><h1>Module <span>memchr</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/memchr/arch/all/memchr.rs.html#1-1022">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Provides architecture independent implementations of <code>memchr</code> and friends.</p>
<p>The main types in this module are <a href="struct.One.html" title="struct memchr::arch::all::memchr::One"><code>One</code></a>, <a href="struct.Two.html" title="struct memchr::arch::all::memchr::Two"><code>Two</code></a> and <a href="struct.Three.html" title="struct memchr::arch::all::memchr::Three"><code>Three</code></a>. They are for
searching for one, two or three distinct bytes, respectively, in a haystack.
Each type also has corresponding double ended iterators. These searchers
are typically slower than hand-coded vector routines accomplishing the same
task, but are also typically faster than naive scalar code. These routines
effectively work by treating a <code>usize</code> as a vector of 8-bit lanes, and thus
achieves some level of data parallelism even without explicit vector support.</p>
<p>The <code>One</code> searcher also provides a <a href="struct.One.html#method.count" title="method memchr::arch::all::memchr::One::count"><code>One::count</code></a> routine for efficiently
counting the number of times a single byte occurs in a haystack. This is
useful, for example, for counting the number of lines in a haystack. This
routine exists because it is usually faster, especially with a high match
count, than using <a href="struct.One.html#method.find" title="method memchr::arch::all::memchr::One::find"><code>One::find</code></a> repeatedly. (<a href="struct.OneIter.html" title="struct memchr::arch::all::memchr::OneIter"><code>OneIter</code></a> specializes its
<code>Iterator::count</code> implementation to use this routine.)</p>
<p>Only one, two and three bytes are supported because three bytes is about
the point where one sees diminishing returns. Beyond this point and its
probably (but not necessarily) better to just use a simple <code>[bool; 256]</code> array
or similar. However, it depends mightily on the specific work-load and the
expected match frequency.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.One.html" title="struct memchr::arch::all::memchr::One">One</a></dt><dd>Finds all occurrences of a single byte in a haystack.</dd><dt><a class="struct" href="struct.OneIter.html" title="struct memchr::arch::all::memchr::OneIter">OneIter</a></dt><dd>An iterator over all occurrences of a single byte in a haystack.</dd><dt><a class="struct" href="struct.Three.html" title="struct memchr::arch::all::memchr::Three">Three</a></dt><dd>Finds all occurrences of three bytes in a haystack.</dd><dt><a class="struct" href="struct.ThreeIter.html" title="struct memchr::arch::all::memchr::ThreeIter">Three<wbr>Iter</a></dt><dd>An iterator over all occurrences of three possible bytes in a haystack.</dd><dt><a class="struct" href="struct.Two.html" title="struct memchr::arch::all::memchr::Two">Two</a></dt><dd>Finds all occurrences of two bytes in a haystack.</dd><dt><a class="struct" href="struct.TwoIter.html" title="struct memchr::arch::all::memchr::TwoIter">TwoIter</a></dt><dd>An iterator over all occurrences of two possible bytes in a haystack.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["One","OneIter","Three","ThreeIter","Two","TwoIter"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,10 @@
<!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="Provides an architecture independent implementation of the “packed pair” algorithm."><title>memchr::arch::all::packedpair - 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"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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 mod"><!--[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="#">Module packedpair</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module packedpair</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In memchr::<wbr>arch::<wbr>all</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">memchr</a>::<wbr><a href="../../index.html">arch</a>::<wbr><a href="../index.html">all</a></div><h1>Module <span>packedpair</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/memchr/arch/all/packedpair/mod.rs.html#1-359">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Provides an architecture independent implementation of the “packed pair”
algorithm.</p>
<p>The “packed pair” algorithm is based on the <a href="http://0x80.pl/articles/simd-strfind.html#first-and-last">generic SIMD</a> algorithm. The main
difference is that it (by default) uses a background distribution of byte
frequencies to heuristically select the pair of bytes to search for. Note that
this module provides an architecture independent version that doesnt do as
good of a job keeping the search for candidates inside a SIMD hot path. It
however can be good enough in many circumstances.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Finder.html" title="struct memchr::arch::all::packedpair::Finder">Finder</a></dt><dd>An architecture independent “packed pair” finder.</dd><dt><a class="struct" href="struct.Pair.html" title="struct memchr::arch::all::packedpair::Pair">Pair</a></dt><dd>A pair of byte offsets into a needle to use as a predicate.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.HeuristicFrequencyRank.html" title="trait memchr::arch::all::packedpair::HeuristicFrequencyRank">Heuristic<wbr>Frequency<wbr>Rank</a></dt><dd>This trait allows the user to customize the heuristic used to determine the
relative frequency of a given byte in the dataset being searched.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Finder","Pair"],"trait":["HeuristicFrequencyRank"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,66 @@
<!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="This trait allows the user to customize the heuristic used to determine the relative frequency of a given byte in the dataset being searched."><title>HeuristicFrequencyRank in memchr::arch::all::packedpair - 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"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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 trait"><!--[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="#">HeuristicFrequencyRank</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Heuristic<wbr>Frequency<wbr>Rank</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.rank" title="rank">rank</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-HeuristicFrequencyRank-for-%26R" title="&#38;&#39;a R">&#38;&#39;a R</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In memchr::<wbr>arch::<wbr>all::<wbr>packedpair</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">memchr</a>::<wbr><a href="../../index.html">arch</a>::<wbr><a href="../index.html">all</a>::<wbr><a href="index.html">packedpair</a></div><h1>Trait <span class="trait">Heuristic<wbr>Frequency<wbr>Rank</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/memchr/arch/all/packedpair/mod.rs.html#309-318">Source</a> </span></div><pre class="rust item-decl"><code>pub trait HeuristicFrequencyRank {
// Required method
fn <a href="#tymethod.rank" class="fn">rank</a>(&amp;self, byte: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>;
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This trait allows the user to customize the heuristic used to determine the
relative frequency of a given byte in the dataset being searched.</p>
<p>The use of this trait can have a dramatic impact on performance depending
on the type of data being searched. The details of why are explained in the
docs of <a href="../../../memmem/enum.Prefilter.html" title="enum memchr::memmem::Prefilter"><code>crate::memmem::Prefilter</code></a>. To summarize, the core algorithm uses
a prefilter to quickly identify candidate matches that are later verified
more slowly. This prefilter is implemented in terms of trying to find
<code>rare</code> bytes at specific offsets that will occur less frequently in the
dataset. While the concept of a <code>rare</code> byte is similar for most datasets,
there are some specific datasets (like binary executables) that have
dramatically different byte distributions. For these datasets customizing
the byte frequency heuristic can have a massive impact on performance, and
might even need to be done at runtime.</p>
<p>The default implementation of <code>HeuristicFrequencyRank</code> reads from the
static frequency table defined in <code>src/memmem/byte_frequencies.rs</code>. This
is optimal for most inputs, so if you are unsure of the impact of using a
custom <code>HeuristicFrequencyRank</code> you should probably just use the default.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memchr::{
arch::all::packedpair::HeuristicFrequencyRank,
memmem::FinderBuilder,
};
<span class="doccomment">/// A byte-frequency table that is good for scanning binary executables.
</span><span class="kw">struct </span>Binary;
<span class="kw">impl </span>HeuristicFrequencyRank <span class="kw">for </span>Binary {
<span class="kw">fn </span>rank(<span class="kw-2">&amp;</span><span class="self">self</span>, byte: u8) -&gt; u8 {
<span class="kw">const </span>TABLE: [u8; <span class="number">256</span>] = [
<span class="number">255</span>, <span class="number">128</span>, <span class="number">61</span>, <span class="number">43</span>, <span class="number">50</span>, <span class="number">41</span>, <span class="number">27</span>, <span class="number">28</span>, <span class="number">57</span>, <span class="number">15</span>, <span class="number">21</span>, <span class="number">13</span>, <span class="number">24</span>, <span class="number">17</span>, <span class="number">17</span>,
<span class="number">89</span>, <span class="number">58</span>, <span class="number">16</span>, <span class="number">11</span>, <span class="number">7</span>, <span class="number">14</span>, <span class="number">23</span>, <span class="number">7</span>, <span class="number">6</span>, <span class="number">24</span>, <span class="number">9</span>, <span class="number">6</span>, <span class="number">5</span>, <span class="number">9</span>, <span class="number">4</span>, <span class="number">7</span>, <span class="number">16</span>,
<span class="number">68</span>, <span class="number">11</span>, <span class="number">9</span>, <span class="number">6</span>, <span class="number">88</span>, <span class="number">7</span>, <span class="number">4</span>, <span class="number">4</span>, <span class="number">23</span>, <span class="number">9</span>, <span class="number">4</span>, <span class="number">8</span>, <span class="number">8</span>, <span class="number">5</span>, <span class="number">10</span>, <span class="number">4</span>, <span class="number">30</span>, <span class="number">11</span>,
<span class="number">9</span>, <span class="number">24</span>, <span class="number">11</span>, <span class="number">5</span>, <span class="number">5</span>, <span class="number">5</span>, <span class="number">19</span>, <span class="number">11</span>, <span class="number">6</span>, <span class="number">17</span>, <span class="number">9</span>, <span class="number">9</span>, <span class="number">6</span>, <span class="number">8</span>,
<span class="number">48</span>, <span class="number">58</span>, <span class="number">11</span>, <span class="number">14</span>, <span class="number">53</span>, <span class="number">40</span>, <span class="number">9</span>, <span class="number">9</span>, <span class="number">254</span>, <span class="number">35</span>, <span class="number">3</span>, <span class="number">6</span>, <span class="number">52</span>, <span class="number">23</span>, <span class="number">6</span>, <span class="number">6</span>, <span class="number">27</span>,
<span class="number">4</span>, <span class="number">7</span>, <span class="number">11</span>, <span class="number">14</span>, <span class="number">13</span>, <span class="number">10</span>, <span class="number">11</span>, <span class="number">11</span>, <span class="number">5</span>, <span class="number">2</span>, <span class="number">10</span>, <span class="number">16</span>, <span class="number">12</span>, <span class="number">6</span>, <span class="number">19</span>,
<span class="number">19</span>, <span class="number">20</span>, <span class="number">5</span>, <span class="number">14</span>, <span class="number">16</span>, <span class="number">31</span>, <span class="number">19</span>, <span class="number">7</span>, <span class="number">14</span>, <span class="number">20</span>, <span class="number">4</span>, <span class="number">4</span>, <span class="number">19</span>, <span class="number">8</span>, <span class="number">18</span>, <span class="number">20</span>, <span class="number">24</span>,
<span class="number">1</span>, <span class="number">25</span>, <span class="number">19</span>, <span class="number">58</span>, <span class="number">29</span>, <span class="number">10</span>, <span class="number">5</span>, <span class="number">15</span>, <span class="number">20</span>, <span class="number">2</span>, <span class="number">2</span>, <span class="number">9</span>, <span class="number">4</span>, <span class="number">3</span>, <span class="number">5</span>,
<span class="number">51</span>, <span class="number">11</span>, <span class="number">4</span>, <span class="number">53</span>, <span class="number">23</span>, <span class="number">39</span>, <span class="number">6</span>, <span class="number">4</span>, <span class="number">13</span>, <span class="number">81</span>, <span class="number">4</span>, <span class="number">186</span>, <span class="number">5</span>, <span class="number">67</span>, <span class="number">3</span>, <span class="number">2</span>, <span class="number">15</span>,
<span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>, <span class="number">3</span>, <span class="number">2</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">5</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">2</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>,
<span class="number">12</span>, <span class="number">2</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">3</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">6</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">1</span>, <span class="number">3</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">9</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">0</span>,
<span class="number">2</span>, <span class="number">2</span>, <span class="number">4</span>, <span class="number">4</span>, <span class="number">11</span>, <span class="number">6</span>, <span class="number">7</span>, <span class="number">3</span>, <span class="number">6</span>, <span class="number">9</span>, <span class="number">4</span>, <span class="number">5</span>,
<span class="number">46</span>, <span class="number">18</span>, <span class="number">8</span>, <span class="number">18</span>, <span class="number">17</span>, <span class="number">3</span>, <span class="number">8</span>, <span class="number">20</span>, <span class="number">16</span>, <span class="number">10</span>, <span class="number">3</span>, <span class="number">7</span>, <span class="number">175</span>, <span class="number">4</span>, <span class="number">6</span>, <span class="number">7</span>, <span class="number">13</span>,
<span class="number">3</span>, <span class="number">7</span>, <span class="number">3</span>, <span class="number">3</span>, <span class="number">1</span>, <span class="number">3</span>, <span class="number">3</span>, <span class="number">10</span>, <span class="number">3</span>, <span class="number">1</span>, <span class="number">5</span>, <span class="number">2</span>, <span class="number">0</span>, <span class="number">1</span>, <span class="number">2</span>,
<span class="number">16</span>, <span class="number">3</span>, <span class="number">5</span>, <span class="number">1</span>, <span class="number">6</span>, <span class="number">1</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">58</span>, <span class="number">20</span>, <span class="number">3</span>, <span class="number">14</span>, <span class="number">12</span>, <span class="number">2</span>, <span class="number">1</span>, <span class="number">3</span>, <span class="number">16</span>, <span class="number">3</span>, <span class="number">5</span>,
<span class="number">8</span>, <span class="number">3</span>, <span class="number">1</span>, <span class="number">8</span>, <span class="number">6</span>, <span class="number">17</span>, <span class="number">6</span>, <span class="number">5</span>, <span class="number">3</span>, <span class="number">8</span>, <span class="number">6</span>, <span class="number">13</span>, <span class="number">175</span>,
];
TABLE[byte <span class="kw">as </span>usize]
}
}
<span class="comment">// Create a new finder with the custom heuristic.
</span><span class="kw">let </span>finder = FinderBuilder::new()
.build_forward_with_ranker(Binary, <span class="string">b"\x00\x00\xdd\xdd"</span>);
<span class="comment">// Find needle with custom heuristic.
</span><span class="macro">assert!</span>(finder.find(<span class="string">b"\x00\x00\x00\xdd\xdd"</span>).is_some());</code></pre></div></div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.rank" class="method"><a class="src rightside" href="../../../../src/memchr/arch/all/packedpair/mod.rs.html#317">Source</a><h4 class="code-header">fn <a href="#tymethod.rank" class="fn">rank</a>(&amp;self, byte: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a></h4></section></summary><div class="docblock"><p>Return the heuristic frequency rank of the given byte. A lower rank
means the byte is believed to occur less frequently in the haystack.</p>
<p>Some uses of this heuristic may treat arbitrary absolute rank values as
significant. For example, an implementation detail in this crate may
determine that heuristic prefilters are inappropriate if every byte in
the needle has a “high” rank.</p>
</div></details></div><h2 id="foreign-impls" class="section-header">Implementations on Foreign Types<a href="#foreign-impls" class="anchor">§</a></h2><details class="toggle implementors-toggle"><summary><section id="impl-HeuristicFrequencyRank-for-%26R" class="impl"><a class="src rightside" href="../../../../src/memchr/arch/all/packedpair/mod.rs.html#331-338">Source</a><a href="#impl-HeuristicFrequencyRank-for-%26R" class="anchor">§</a><h3 class="code-header">impl&lt;'a, R&gt; <a class="trait" href="trait.HeuristicFrequencyRank.html" title="trait memchr::arch::all::packedpair::HeuristicFrequencyRank">HeuristicFrequencyRank</a> for <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;'a R</a><div class="where">where
R: <a class="trait" href="trait.HeuristicFrequencyRank.html" title="trait memchr::arch::all::packedpair::HeuristicFrequencyRank">HeuristicFrequencyRank</a>,</div></h3><div class="docblock"><p>This permits passing any implementation of <code>HeuristicFrequencyRank</code> as a
borrowed version of itself.</p>
</div></section></summary><div class="impl-items"><section id="method.rank" class="method trait-impl"><a class="src rightside" href="../../../../src/memchr/arch/all/packedpair/mod.rs.html#335-337">Source</a><a href="#method.rank" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.rank" class="fn">rank</a>(&amp;self, byte: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a></h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../../../../trait.impl/memchr/arch/all/packedpair/trait.HeuristicFrequencyRank.js" async></script></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!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="An implementation of the Rabin-Karp substring search algorithm."><title>memchr::arch::all::rabinkarp - 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"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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 mod"><!--[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="#">Module rabinkarp</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module rabinkarp</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In memchr::<wbr>arch::<wbr>all</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">memchr</a>::<wbr><a href="../../index.html">arch</a>::<wbr><a href="../index.html">all</a></div><h1>Module <span>rabinkarp</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/memchr/arch/all/rabinkarp.rs.html#1-390">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An implementation of the <a href="https://en.wikipedia.org/wiki/Rabin%E2%80%93Karp_algorithm">Rabin-Karp substring search algorithm</a>.</p>
<p>Rabin-Karp works by creating a hash of the needle provided and then computing
a rolling hash for each needle sized window in the haystack. When the rolling
hash matches the hash of the needle, a byte-wise comparison is done to check
if a match exists. The worst case time complexity of Rabin-Karp is <code>O(m * n)</code> where <code>m ~ len(needle)</code> and <code>n ~ len(haystack)</code>. Its worst case space
complexity is constant.</p>
<p>The main utility of Rabin-Karp is that the searcher can be constructed very
quickly with very little memory. This makes it especially useful when searching
for small needles in small haystacks, as it might finish its search before a
beefier algorithm (like Two-Way) even starts.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Finder.html" title="struct memchr::arch::all::rabinkarp::Finder">Finder</a></dt><dd>A forward substring searcher using the Rabin-Karp algorithm.</dd><dt><a class="struct" href="struct.FinderRev.html" title="struct memchr::arch::all::rabinkarp::FinderRev">Finder<wbr>Rev</a></dt><dd>A reverse substring searcher using the Rabin-Karp algorithm.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Finder","FinderRev"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
<!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="An implementation of the Shift-Or substring search algorithm."><title>memchr::arch::all::shiftor - 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"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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 mod"><!--[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="#">Module shiftor</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module shiftor</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In memchr::<wbr>arch::<wbr>all</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">memchr</a>::<wbr><a href="../../index.html">arch</a>::<wbr><a href="../index.html">all</a></div><h1>Module <span>shiftor</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/memchr/arch/all/shiftor.rs.html#1-89">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An implementation of the <a href="https://en.wikipedia.org/wiki/Bitap_algorithm">Shift-Or substring search algorithm</a>.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Finder.html" title="struct memchr::arch::all::shiftor::Finder">Finder</a></dt><dd>A forward substring searcher using the Shift-Or algorithm.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Finder"]};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"fn":["is_equal","is_equal_raw","is_prefix","is_suffix"],"mod":["memchr","packedpair","rabinkarp","shiftor","twoway"]};

View File

@@ -0,0 +1,17 @@
<!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="An implementation of the Two-Way substring search algorithm."><title>memchr::arch::all::twoway - 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"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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 mod"><!--[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="#">Module twoway</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module twoway</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In memchr::<wbr>arch::<wbr>all</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">memchr</a>::<wbr><a href="../../index.html">arch</a>::<wbr><a href="../index.html">all</a></div><h1>Module <span>twoway</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/memchr/arch/all/twoway.rs.html#1-877">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>An implementation of the <a href="https://en.wikipedia.org/wiki/Two-way_string-matching_algorithm">Two-Way substring search algorithm</a>.</p>
<p><a href="struct.Finder.html" title="struct memchr::arch::all::twoway::Finder"><code>Finder</code></a> can be built for forward searches, while <a href="struct.FinderRev.html" title="struct memchr::arch::all::twoway::FinderRev"><code>FinderRev</code></a> can be built
for reverse searches.</p>
<p>Two-Way makes for a nice general purpose substring search algorithm because of
its time and space complexity properties. It also performs well in practice.
Namely, with <code>m = len(needle)</code> and <code>n = len(haystack)</code>, Two-Way takes <code>O(m)</code>
time to create a finder, <code>O(1)</code> space and <code>O(n)</code> search time. In other words,
the preprocessing step is quick, doesnt require any heap memory and the worst
case search time is guaranteed to be linear in the haystack regardless of the
size of the needle.</p>
<p>While vector algorithms will usually beat Two-Way handedly, vector algorithms
also usually have pathological or edge cases that are better handled by Two-Way.
Moreover, not all targets support vector algorithms or implementations for them
simply may not exist yet.</p>
<p>Two-Way can be found in the <code>memmem</code> implementations in at least <a href="https://www.gnu.org/software/libc/">GNU libc</a> and
<a href="https://www.musl-libc.org/">musl</a>.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Finder.html" title="struct memchr::arch::all::twoway::Finder">Finder</a></dt><dd>A forward substring searcher that uses the Two-Way algorithm.</dd><dt><a class="struct" href="struct.FinderRev.html" title="struct memchr::arch::all::twoway::FinderRev">Finder<wbr>Rev</a></dt><dd>A reverse substring searcher that uses the Two-Way algorithm.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Finder","FinderRev"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
<!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="A module with low-level architecture dependent routines."><title>memchr::arch - 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"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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 mod"><!--[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="#">Module arch</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module arch</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate memchr</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">memchr</a></div><h1>Module <span>arch</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/memchr/arch/mod.rs.html#1-16">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A module with low-level architecture dependent routines.</p>
<p>These routines are useful as primitives for tasks not covered by the higher
level crate API.</p>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="all/index.html" title="mod memchr::arch::all">all</a></dt><dd>Contains architecture independent routines.</dd><dt><a class="mod" href="x86_64/index.html" title="mod memchr::arch::x86_64">x86_64</a></dt><dd>Vector algorithms for the <code>x86_64</code> target.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"mod":["all","x86_64"]};

View File

@@ -0,0 +1,2 @@
<!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="Algorithms for the `x86_64` target using 256-bit vectors via AVX2."><title>memchr::arch::x86_64::avx2 - 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"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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 mod"><!--[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="#">Module avx2</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module avx2</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In memchr::<wbr>arch::<wbr>x86_<wbr>64</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">memchr</a>::<wbr><a href="../../index.html">arch</a>::<wbr><a href="../index.html">x86_64</a></div><h1>Module <span>avx2</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/memchr/arch/x86_64/avx2/mod.rs.html#1-6">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Algorithms for the <code>x86_64</code> target using 256-bit vectors via AVX2.</p>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="memchr/index.html" title="mod memchr::arch::x86_64::avx2::memchr">memchr</a></dt><dd>This module defines 256-bit vector implementations of <code>memchr</code> and friends.</dd><dt><a class="mod" href="packedpair/index.html" title="mod memchr::arch::x86_64::avx2::packedpair">packedpair</a></dt><dd>A 256-bit vector implementation of the “packed pair” SIMD algorithm.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1,17 @@
<!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="This module defines 256-bit vector implementations of `memchr` and friends."><title>memchr::arch::x86_64::avx2::memchr - 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"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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 mod"><!--[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="#">Module memchr</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module memchr</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In memchr::<wbr>arch::<wbr>x86_<wbr>64::<wbr>avx2</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">memchr</a>::<wbr><a href="../../../index.html">arch</a>::<wbr><a href="../../index.html">x86_64</a>::<wbr><a href="../index.html">avx2</a></div><h1>Module <span>memchr</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/memchr/arch/x86_64/avx2/memchr.rs.html#1-1352">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This module defines 256-bit vector implementations of <code>memchr</code> and friends.</p>
<p>The main types in this module are <a href="struct.One.html" title="struct memchr::arch::x86_64::avx2::memchr::One"><code>One</code></a>, <a href="struct.Two.html" title="struct memchr::arch::x86_64::avx2::memchr::Two"><code>Two</code></a> and <a href="struct.Three.html" title="struct memchr::arch::x86_64::avx2::memchr::Three"><code>Three</code></a>. They are for
searching for one, two or three distinct bytes, respectively, in a haystack.
Each type also has corresponding double ended iterators. These searchers are
typically much faster than scalar routines accomplishing the same task.</p>
<p>The <code>One</code> searcher also provides a <a href="struct.One.html#method.count" title="method memchr::arch::x86_64::avx2::memchr::One::count"><code>One::count</code></a> routine for efficiently
counting the number of times a single byte occurs in a haystack. This is
useful, for example, for counting the number of lines in a haystack. This
routine exists because it is usually faster, especially with a high match
count, then using <a href="struct.One.html#method.find" title="method memchr::arch::x86_64::avx2::memchr::One::find"><code>One::find</code></a> repeatedly. (<a href="struct.OneIter.html" title="struct memchr::arch::x86_64::avx2::memchr::OneIter"><code>OneIter</code></a> specializes its
<code>Iterator::count</code> implementation to use this routine.)</p>
<p>Only one, two and three bytes are supported because three bytes is about
the point where one sees diminishing returns. Beyond this point and its
probably (but not necessarily) better to just use a simple <code>[bool; 256]</code> array
or similar. However, it depends mightily on the specific work-load and the
expected match frequency.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.One.html" title="struct memchr::arch::x86_64::avx2::memchr::One">One</a></dt><dd>Finds all occurrences of a single byte in a haystack.</dd><dt><a class="struct" href="struct.OneIter.html" title="struct memchr::arch::x86_64::avx2::memchr::OneIter">OneIter</a></dt><dd>An iterator over all occurrences of a single byte in a haystack.</dd><dt><a class="struct" href="struct.Three.html" title="struct memchr::arch::x86_64::avx2::memchr::Three">Three</a></dt><dd>Finds all occurrences of three bytes in a haystack.</dd><dt><a class="struct" href="struct.ThreeIter.html" title="struct memchr::arch::x86_64::avx2::memchr::ThreeIter">Three<wbr>Iter</a></dt><dd>An iterator over all occurrences of three possible bytes in a haystack.</dd><dt><a class="struct" href="struct.Two.html" title="struct memchr::arch::x86_64::avx2::memchr::Two">Two</a></dt><dd>Finds all occurrences of two bytes in a haystack.</dd><dt><a class="struct" href="struct.TwoIter.html" title="struct memchr::arch::x86_64::avx2::memchr::TwoIter">TwoIter</a></dt><dd>An iterator over all occurrences of two possible bytes in a haystack.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["One","OneIter","Three","ThreeIter","Two","TwoIter"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
<!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="A 256-bit vector implementation of the “packed pair” SIMD algorithm."><title>memchr::arch::x86_64::avx2::packedpair - 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"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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 mod"><!--[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="#">Module packedpair</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module packedpair</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In memchr::<wbr>arch::<wbr>x86_<wbr>64::<wbr>avx2</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">memchr</a>::<wbr><a href="../../../index.html">arch</a>::<wbr><a href="../../index.html">x86_64</a>::<wbr><a href="../index.html">avx2</a></div><h1>Module <span>packedpair</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/memchr/arch/x86_64/avx2/packedpair.rs.html#1-272">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A 256-bit vector implementation of the “packed pair” SIMD algorithm.</p>
<p>The “packed pair” algorithm is based on the <a href="http://0x80.pl/articles/simd-strfind.html#first-and-last">generic SIMD</a> algorithm. The main
difference is that it (by default) uses a background distribution of byte
frequencies to heuristically select the pair of bytes to search for.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Finder.html" title="struct memchr::arch::x86_64::avx2::packedpair::Finder">Finder</a></dt><dd>A “packed pair” finder that uses 256-bit vector operations.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Finder"]};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"mod":["memchr","packedpair"]};

View File

@@ -0,0 +1,2 @@
<!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="Vector algorithms for the `x86_64` target."><title>memchr::arch::x86_64 - 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"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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 mod"><!--[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="#">Module x86_64</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module x86_64</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In memchr::<wbr>arch</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">memchr</a>::<wbr><a href="../index.html">arch</a></div><h1>Module <span>x86_64</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/memchr/arch/x86_64/mod.rs.html#1-8">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Vector algorithms for the <code>x86_64</code> target.</p>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="avx2/index.html" title="mod memchr::arch::x86_64::avx2">avx2</a></dt><dd>Algorithms for the <code>x86_64</code> target using 256-bit vectors via AVX2.</dd><dt><a class="mod" href="sse2/index.html" title="mod memchr::arch::x86_64::sse2">sse2</a></dt><dd>Algorithms for the <code>x86_64</code> target using 128-bit vectors via SSE2.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"mod":["avx2","sse2"]};

View File

@@ -0,0 +1,2 @@
<!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="Algorithms for the `x86_64` target using 128-bit vectors via SSE2."><title>memchr::arch::x86_64::sse2 - 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"><meta name="rustdoc-vars" data-root-path="../../../../" data-static-root-path="../../../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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 mod"><!--[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="#">Module sse2</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module sse2</a></h2><h3><a href="#modules">Module Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In memchr::<wbr>arch::<wbr>x86_<wbr>64</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">memchr</a>::<wbr><a href="../../index.html">arch</a>::<wbr><a href="../index.html">x86_64</a></div><h1>Module <span>sse2</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/memchr/arch/x86_64/sse2/mod.rs.html#1-6">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Algorithms for the <code>x86_64</code> target using 128-bit vectors via SSE2.</p>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="memchr/index.html" title="mod memchr::arch::x86_64::sse2::memchr">memchr</a></dt><dd>This module defines 128-bit vector implementations of <code>memchr</code> and friends.</dd><dt><a class="mod" href="packedpair/index.html" title="mod memchr::arch::x86_64::sse2::packedpair">packedpair</a></dt><dd>A 128-bit vector implementation of the “packed pair” SIMD algorithm.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1,17 @@
<!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="This module defines 128-bit vector implementations of `memchr` and friends."><title>memchr::arch::x86_64::sse2::memchr - 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"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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 mod"><!--[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="#">Module memchr</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module memchr</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In memchr::<wbr>arch::<wbr>x86_<wbr>64::<wbr>sse2</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">memchr</a>::<wbr><a href="../../../index.html">arch</a>::<wbr><a href="../../index.html">x86_64</a>::<wbr><a href="../index.html">sse2</a></div><h1>Module <span>memchr</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/memchr/arch/x86_64/sse2/memchr.rs.html#1-1077">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This module defines 128-bit vector implementations of <code>memchr</code> and friends.</p>
<p>The main types in this module are <a href="struct.One.html" title="struct memchr::arch::x86_64::sse2::memchr::One"><code>One</code></a>, <a href="struct.Two.html" title="struct memchr::arch::x86_64::sse2::memchr::Two"><code>Two</code></a> and <a href="struct.Three.html" title="struct memchr::arch::x86_64::sse2::memchr::Three"><code>Three</code></a>. They are for
searching for one, two or three distinct bytes, respectively, in a haystack.
Each type also has corresponding double ended iterators. These searchers are
typically much faster than scalar routines accomplishing the same task.</p>
<p>The <code>One</code> searcher also provides a <a href="struct.One.html#method.count" title="method memchr::arch::x86_64::sse2::memchr::One::count"><code>One::count</code></a> routine for efficiently
counting the number of times a single byte occurs in a haystack. This is
useful, for example, for counting the number of lines in a haystack. This
routine exists because it is usually faster, especially with a high match
count, than using <a href="struct.One.html#method.find" title="method memchr::arch::x86_64::sse2::memchr::One::find"><code>One::find</code></a> repeatedly. (<a href="struct.OneIter.html" title="struct memchr::arch::x86_64::sse2::memchr::OneIter"><code>OneIter</code></a> specializes its
<code>Iterator::count</code> implementation to use this routine.)</p>
<p>Only one, two and three bytes are supported because three bytes is about
the point where one sees diminishing returns. Beyond this point and its
probably (but not necessarily) better to just use a simple <code>[bool; 256]</code> array
or similar. However, it depends mightily on the specific work-load and the
expected match frequency.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.One.html" title="struct memchr::arch::x86_64::sse2::memchr::One">One</a></dt><dd>Finds all occurrences of a single byte in a haystack.</dd><dt><a class="struct" href="struct.OneIter.html" title="struct memchr::arch::x86_64::sse2::memchr::OneIter">OneIter</a></dt><dd>An iterator over all occurrences of a single byte in a haystack.</dd><dt><a class="struct" href="struct.Three.html" title="struct memchr::arch::x86_64::sse2::memchr::Three">Three</a></dt><dd>Finds all occurrences of three bytes in a haystack.</dd><dt><a class="struct" href="struct.ThreeIter.html" title="struct memchr::arch::x86_64::sse2::memchr::ThreeIter">Three<wbr>Iter</a></dt><dd>An iterator over all occurrences of three possible bytes in a haystack.</dd><dt><a class="struct" href="struct.Two.html" title="struct memchr::arch::x86_64::sse2::memchr::Two">Two</a></dt><dd>Finds all occurrences of two bytes in a haystack.</dd><dt><a class="struct" href="struct.TwoIter.html" title="struct memchr::arch::x86_64::sse2::memchr::TwoIter">TwoIter</a></dt><dd>An iterator over all occurrences of two possible bytes in a haystack.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["One","OneIter","Three","ThreeIter","Two","TwoIter"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
<!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="A 128-bit vector implementation of the “packed pair” SIMD algorithm."><title>memchr::arch::x86_64::sse2::packedpair - 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"><meta name="rustdoc-vars" data-root-path="../../../../../" data-static-root-path="../../../../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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 mod"><!--[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="#">Module packedpair</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module packedpair</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In memchr::<wbr>arch::<wbr>x86_<wbr>64::<wbr>sse2</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">memchr</a>::<wbr><a href="../../../index.html">arch</a>::<wbr><a href="../../index.html">x86_64</a>::<wbr><a href="../index.html">sse2</a></div><h1>Module <span>packedpair</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/memchr/arch/x86_64/sse2/packedpair.rs.html#1-232">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A 128-bit vector implementation of the “packed pair” SIMD algorithm.</p>
<p>The “packed pair” algorithm is based on the <a href="http://0x80.pl/articles/simd-strfind.html#first-and-last">generic SIMD</a> algorithm. The main
difference is that it (by default) uses a background distribution of byte
frequencies to heuristically select the pair of bytes to search for.</p>
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Finder.html" title="struct memchr::arch::x86_64::sse2::packedpair::Finder">Finder</a></dt><dd>A “packed pair” finder that uses 128-bit vector operations.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"struct":["Finder"]};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"mod":["memchr","packedpair"]};

View File

@@ -0,0 +1,15 @@
<!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="Search for the first occurrence of a byte in a slice."><title>memchr in memchr - 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"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">memchr</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">memchr</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate memchr</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">memchr</a></div><h1>Function <span class="fn">memchr</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/memchr/memchr.rs.html#27-35">Source</a> </span></div><pre class="rust item-decl"><code>pub fn memchr(needle: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>, haystack: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Search for the first occurrence of a byte in a slice.</p>
<p>This returns the index corresponding to the first occurrence of <code>needle</code> in
<code>haystack</code>, or <code>None</code> if one is not found. If an index is returned, it is
guaranteed to be less than <code>haystack.len()</code>.</p>
<p>While this is semantically the same as something like
<code>haystack.iter().position(|&amp;b| b == needle)</code>, this routine will attempt to
use highly optimized vector operations that can be an order of magnitude
faster (or more).</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<p>This shows how to find the first position of a byte in a byte string.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memchr::memchr;
<span class="kw">let </span>haystack = <span class="string">b"the quick brown fox"</span>;
<span class="macro">assert_eq!</span>(memchr(<span class="string">b'k'</span>, haystack), <span class="prelude-val">Some</span>(<span class="number">8</span>));</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,16 @@
<!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="Search for the first occurrence of two possible bytes in a haystack."><title>memchr2 in memchr - 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"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">memchr2</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">memchr2</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate memchr</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">memchr</a></div><h1>Function <span class="fn">memchr2</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/memchr/memchr.rs.html#92-100">Source</a> </span></div><pre class="rust item-decl"><code>pub fn memchr2(needle1: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>, needle2: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>, haystack: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Search for the first occurrence of two possible bytes in a haystack.</p>
<p>This returns the index corresponding to the first occurrence of one of the
needle bytes in <code>haystack</code>, or <code>None</code> if one is not found. If an index is
returned, it is guaranteed to be less than <code>haystack.len()</code>.</p>
<p>While this is semantically the same as something like
<code>haystack.iter().position(|&amp;b| b == needle1 || b == needle2)</code>, this routine
will attempt to use highly optimized vector operations that can be an order
of magnitude faster (or more).</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<p>This shows how to find the first position of one of two possible bytes in a
haystack.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memchr::memchr2;
<span class="kw">let </span>haystack = <span class="string">b"the quick brown fox"</span>;
<span class="macro">assert_eq!</span>(memchr2(<span class="string">b'k'</span>, <span class="string">b'q'</span>, haystack), <span class="prelude-val">Some</span>(<span class="number">4</span>));</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,8 @@
<!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="Returns an iterator over all occurrences of the needles in a haystack."><title>memchr2_iter in memchr - 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"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">memchr2_iter</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></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">memchr</a></div><h1>Function <span class="fn">memchr2_<wbr>iter</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/memchr/memchr.rs.html#232-238">Source</a> </span></div><pre class="rust item-decl"><code>pub fn memchr2_iter&lt;'h&gt;(
needle1: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>,
needle2: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>,
haystack: &amp;'h [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>],
) -&gt; <a class="struct" href="struct.Memchr2.html" title="struct memchr::Memchr2">Memchr2</a>&lt;'h&gt; <a href="#" class="tooltip" data-notable-ty="Memchr2&lt;&#39;h&gt;"></a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns an iterator over all occurrences of the needles in a haystack.</p>
<p>The iterator returned implements <code>DoubleEndedIterator</code>. This means it
can also be used to find occurrences in reverse order.</p>
</div></details><script type="text/json" id="notable-traits-data">{"Memchr2<'h>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Memchr2.html\" title=\"struct memchr::Memchr2\">Memchr2</a>&lt;'h&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'h&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"struct.Memchr2.html\" title=\"struct memchr::Memchr2\">Memchr2</a>&lt;'h&gt;</div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = <a class=\"primitive\" href=\"https://doc.rust-lang.org/1.93.1/std/primitive.usize.html\">usize</a>;</div>"}</script></section></div></main></body></html>

View File

@@ -0,0 +1,21 @@
<!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="Search for the first occurrence of three possible bytes in a haystack."><title>memchr3 in memchr - 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"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">memchr3</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">memchr3</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate memchr</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">memchr</a></div><h1>Function <span class="fn">memchr3</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/memchr/memchr.rs.html#158-171">Source</a> </span></div><pre class="rust item-decl"><code>pub fn memchr3(
needle1: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>,
needle2: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>,
needle3: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>,
haystack: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>],
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Search for the first occurrence of three possible bytes in a haystack.</p>
<p>This returns the index corresponding to the first occurrence of one of the
needle bytes in <code>haystack</code>, or <code>None</code> if one is not found. If an index is
returned, it is guaranteed to be less than <code>haystack.len()</code>.</p>
<p>While this is semantically the same as something like
<code>haystack.iter().position(|&amp;b| b == needle1 || b == needle2 || b == needle3)</code>,
this routine will attempt to use highly optimized vector operations that
can be an order of magnitude faster (or more).</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<p>This shows how to find the first position of one of three possible bytes in
a haystack.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memchr::memchr3;
<span class="kw">let </span>haystack = <span class="string">b"the quick brown fox"</span>;
<span class="macro">assert_eq!</span>(memchr3(<span class="string">b'k'</span>, <span class="string">b'q'</span>, <span class="string">b'u'</span>, haystack), <span class="prelude-val">Some</span>(<span class="number">4</span>));</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,9 @@
<!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="Returns an iterator over all occurrences of the needles in a haystack."><title>memchr3_iter in memchr - 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"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">memchr3_iter</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></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">memchr</a></div><h1>Function <span class="fn">memchr3_<wbr>iter</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/memchr/memchr.rs.html#256-263">Source</a> </span></div><pre class="rust item-decl"><code>pub fn memchr3_iter&lt;'h&gt;(
needle1: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>,
needle2: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>,
needle3: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>,
haystack: &amp;'h [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>],
) -&gt; <a class="struct" href="struct.Memchr3.html" title="struct memchr::Memchr3">Memchr3</a>&lt;'h&gt; <a href="#" class="tooltip" data-notable-ty="Memchr3&lt;&#39;h&gt;"></a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns an iterator over all occurrences of the needles in a haystack.</p>
<p>The iterator returned implements <code>DoubleEndedIterator</code>. This means it
can also be used to find occurrences in reverse order.</p>
</div></details><script type="text/json" id="notable-traits-data">{"Memchr3<'h>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Memchr3.html\" title=\"struct memchr::Memchr3\">Memchr3</a>&lt;'h&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'h&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"struct.Memchr3.html\" title=\"struct memchr::Memchr3\">Memchr3</a>&lt;'h&gt;</div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = <a class=\"primitive\" href=\"https://doc.rust-lang.org/1.93.1/std/primitive.usize.html\">usize</a>;</div>"}</script></section></div></main></body></html>

View File

@@ -0,0 +1,4 @@
<!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="Returns an iterator over all occurrences of the needle in a haystack."><title>memchr_iter in memchr - 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"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">memchr_iter</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></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">memchr</a></div><h1>Function <span class="fn">memchr_<wbr>iter</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/memchr/memchr.rs.html#216-218">Source</a> </span></div><pre class="rust item-decl"><code>pub fn memchr_iter&lt;'h&gt;(needle: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>, haystack: &amp;'h [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -&gt; <a class="struct" href="struct.Memchr.html" title="struct memchr::Memchr">Memchr</a>&lt;'h&gt; <a href="#" class="tooltip" data-notable-ty="Memchr&lt;&#39;h&gt;"></a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns an iterator over all occurrences of the needle in a haystack.</p>
<p>The iterator returned implements <code>DoubleEndedIterator</code>. This means it
can also be used to find occurrences in reverse order.</p>
</div></details><script type="text/json" id="notable-traits-data">{"Memchr<'h>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.Memchr.html\" title=\"struct memchr::Memchr\">Memchr</a>&lt;'h&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'h&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"struct.Memchr.html\" title=\"struct memchr::Memchr\">Memchr</a>&lt;'h&gt;</div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = <a class=\"primitive\" href=\"https://doc.rust-lang.org/1.93.1/std/primitive.usize.html\">usize</a>;</div>"}</script></section></div></main></body></html>

View File

@@ -0,0 +1,15 @@
<!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="Search for the last occurrence of a byte in a slice."><title>memrchr in memchr - 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"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">memrchr</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">memrchr</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate memchr</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">memchr</a></div><h1>Function <span class="fn">memrchr</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/memchr/memchr.rs.html#59-67">Source</a> </span></div><pre class="rust item-decl"><code>pub fn memrchr(needle: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>, haystack: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Search for the last occurrence of a byte in a slice.</p>
<p>This returns the index corresponding to the last occurrence of <code>needle</code> in
<code>haystack</code>, or <code>None</code> if one is not found. If an index is returned, it is
guaranteed to be less than <code>haystack.len()</code>.</p>
<p>While this is semantically the same as something like
<code>haystack.iter().rposition(|&amp;b| b == needle)</code>, this routine will attempt to
use highly optimized vector operations that can be an order of magnitude
faster (or more).</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<p>This shows how to find the last position of a byte in a byte string.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memchr::memrchr;
<span class="kw">let </span>haystack = <span class="string">b"the quick brown fox"</span>;
<span class="macro">assert_eq!</span>(memrchr(<span class="string">b'o'</span>, haystack), <span class="prelude-val">Some</span>(<span class="number">17</span>));</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,16 @@
<!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="Search for the last occurrence of two possible bytes in a haystack."><title>memrchr2 in memchr - 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"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">memrchr2</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">memrchr2</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate memchr</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">memchr</a></div><h1>Function <span class="fn">memrchr2</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/memchr/memchr.rs.html#125-133">Source</a> </span></div><pre class="rust item-decl"><code>pub fn memrchr2(needle1: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>, needle2: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>, haystack: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Search for the last occurrence of two possible bytes in a haystack.</p>
<p>This returns the index corresponding to the last occurrence of one of the
needle bytes in <code>haystack</code>, or <code>None</code> if one is not found. If an index is
returned, it is guaranteed to be less than <code>haystack.len()</code>.</p>
<p>While this is semantically the same as something like
<code>haystack.iter().rposition(|&amp;b| b == needle1 || b == needle2)</code>, this
routine will attempt to use highly optimized vector operations that can be
an order of magnitude faster (or more).</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<p>This shows how to find the last position of one of two possible bytes in a
haystack.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memchr::memrchr2;
<span class="kw">let </span>haystack = <span class="string">b"the quick brown fox"</span>;
<span class="macro">assert_eq!</span>(memrchr2(<span class="string">b'k'</span>, <span class="string">b'o'</span>, haystack), <span class="prelude-val">Some</span>(<span class="number">17</span>));</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,7 @@
<!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="Returns an iterator over all occurrences of the needles in a haystack, in reverse."><title>memrchr2_iter in memchr - 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"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">memrchr2_iter</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></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">memchr</a></div><h1>Function <span class="fn">memrchr2_<wbr>iter</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/memchr/memchr.rs.html#243-249">Source</a> </span></div><pre class="rust item-decl"><code>pub fn memrchr2_iter(
needle1: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>,
needle2: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>,
haystack: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>],
) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/iter/adapters/rev/struct.Rev.html" title="struct core::iter::adapters::rev::Rev">Rev</a>&lt;<a class="struct" href="struct.Memchr2.html" title="struct memchr::Memchr2">Memchr2</a>&lt;'_&gt;&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns an iterator over all occurrences of the needles in a haystack, in
reverse.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,21 @@
<!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="Search for the last occurrence of three possible bytes in a haystack."><title>memrchr3 in memchr - 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"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">memrchr3</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">memrchr3</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example" title="Example">Example</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate memchr</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">memchr</a></div><h1>Function <span class="fn">memrchr3</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/memchr/memchr.rs.html#196-209">Source</a> </span></div><pre class="rust item-decl"><code>pub fn memrchr3(
needle1: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>,
needle2: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>,
needle3: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>,
haystack: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>],
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Search for the last occurrence of three possible bytes in a haystack.</p>
<p>This returns the index corresponding to the last occurrence of one of the
needle bytes in <code>haystack</code>, or <code>None</code> if one is not found. If an index is
returned, it is guaranteed to be less than <code>haystack.len()</code>.</p>
<p>While this is semantically the same as something like
<code>haystack.iter().rposition(|&amp;b| b == needle1 || b == needle2 || b == needle3)</code>,
this routine will attempt to use highly optimized vector operations that
can be an order of magnitude faster (or more).</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<p>This shows how to find the last position of one of three possible bytes in
a haystack.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memchr::memrchr3;
<span class="kw">let </span>haystack = <span class="string">b"the quick brown fox"</span>;
<span class="macro">assert_eq!</span>(memrchr3(<span class="string">b'k'</span>, <span class="string">b'o'</span>, <span class="string">b'n'</span>, haystack), <span class="prelude-val">Some</span>(<span class="number">17</span>));</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,8 @@
<!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="Returns an iterator over all occurrences of the needles in a haystack, in reverse."><title>memrchr3_iter in memchr - 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"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">memrchr3_iter</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></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">memchr</a></div><h1>Function <span class="fn">memrchr3_<wbr>iter</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/memchr/memchr.rs.html#268-275">Source</a> </span></div><pre class="rust item-decl"><code>pub fn memrchr3_iter(
needle1: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>,
needle2: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>,
needle3: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>,
haystack: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>],
) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/iter/adapters/rev/struct.Rev.html" title="struct core::iter::adapters::rev::Rev">Rev</a>&lt;<a class="struct" href="struct.Memchr3.html" title="struct memchr::Memchr3">Memchr3</a>&lt;'_&gt;&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns an iterator over all occurrences of the needles in a haystack, in
reverse.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,3 @@
<!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="Returns an iterator over all occurrences of the needle in a haystack, in reverse."><title>memrchr_iter in memchr - 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"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">memrchr_iter</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><div id="rustdoc-modnav"></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">memchr</a></div><h1>Function <span class="fn">memrchr_<wbr>iter</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/memchr/memchr.rs.html#223-225">Source</a> </span></div><pre class="rust item-decl"><code>pub fn memrchr_iter(needle: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>, haystack: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -&gt; <a class="struct" href="https://doc.rust-lang.org/1.93.1/core/iter/adapters/rev/struct.Rev.html" title="struct core::iter::adapters::rev::Rev">Rev</a>&lt;<a class="struct" href="struct.Memchr.html" title="struct memchr::Memchr">Memchr</a>&lt;'_&gt;&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns an iterator over all occurrences of the needle in a haystack, in
reverse.</p>
</div></details></section></div></main></body></html>

View File

@@ -0,0 +1,138 @@
<!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="This library provides heavily optimized routines for string search primitives."><title>memchr - 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"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.js" data-settings-js="settings-c38705f0.js" ><script src="../static.files/storage-e2aeef58.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-a410ff4d.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 mod crate"><!--[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="#">Crate memchr</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#overview" title="Overview">Overview</a></li><li><a href="#example-using-memchr" title="Example: using `memchr`">Example: using <code>memchr</code></a></li><li><a href="#example-matching-one-of-three-possible-bytes" title="Example: matching one of three possible bytes">Example: matching one of three possible bytes</a></li><li><a href="#example-iterating-over-substring-matches" title="Example: iterating over substring matches">Example: iterating over substring matches</a></li><li><a href="#example-repeating-a-search-for-the-same-needle" title="Example: repeating a search for the same needle">Example: repeating a search for the same needle</a></li><li><a href="#why-use-this-crate" title="Why use this crate?">Why use this crate?</a></li><li><a href="#crate-features" title="Crate features">Crate features</a></li></ul><h3><a href="#modules">Crate Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"></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"><h1>Crate <span>memchr</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/memchr/lib.rs.html#1-221">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This library provides heavily optimized routines for string search primitives.</p>
<h2 id="overview"><a class="doc-anchor" href="#overview">§</a>Overview</h2>
<p>This section gives a brief high level overview of what this crate offers.</p>
<ul>
<li>The top-level module provides routines for searching for 1, 2 or 3 bytes
in the forward or reverse direction. When searching for more than one byte,
positions are considered a match if the byte at that position matches any
of the bytes.</li>
<li>The <a href="memmem/index.html" title="mod memchr::memmem"><code>memmem</code></a> sub-module provides forward and reverse substring search
routines.</li>
</ul>
<p>In all such cases, routines operate on <code>&amp;[u8]</code> without regard to encoding. This
is exactly what you want when searching either UTF-8 or arbitrary bytes.</p>
<h2 id="example-using-memchr"><a class="doc-anchor" href="#example-using-memchr">§</a>Example: using <code>memchr</code></h2>
<p>This example shows how to use <code>memchr</code> to find the first occurrence of <code>z</code> in
a haystack:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memchr::memchr;
<span class="kw">let </span>haystack = <span class="string">b"foo bar baz quuz"</span>;
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">10</span>), memchr(<span class="string">b'z'</span>, haystack));</code></pre></div><h2 id="example-matching-one-of-three-possible-bytes"><a class="doc-anchor" href="#example-matching-one-of-three-possible-bytes">§</a>Example: matching one of three possible bytes</h2>
<p>This examples shows how to use <code>memrchr3</code> to find occurrences of <code>a</code>, <code>b</code> or
<code>c</code>, starting at the end of the haystack.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memchr::memchr3_iter;
<span class="kw">let </span>haystack = <span class="string">b"xyzaxyzbxyzc"</span>;
<span class="kw">let </span><span class="kw-2">mut </span>it = memchr3_iter(<span class="string">b'a'</span>, <span class="string">b'b'</span>, <span class="string">b'c'</span>, haystack).rev();
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">11</span>), it.next());
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">7</span>), it.next());
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">3</span>), it.next());
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, it.next());</code></pre></div><h2 id="example-iterating-over-substring-matches"><a class="doc-anchor" href="#example-iterating-over-substring-matches">§</a>Example: iterating over substring matches</h2>
<p>This example shows how to use the <a href="memmem/index.html" title="mod memchr::memmem"><code>memmem</code></a> sub-module to find occurrences of
a substring in a haystack.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memchr::memmem;
<span class="kw">let </span>haystack = <span class="string">b"foo bar foo baz foo"</span>;
<span class="kw">let </span><span class="kw-2">mut </span>it = memmem::find_iter(haystack, <span class="string">"foo"</span>);
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">0</span>), it.next());
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">8</span>), it.next());
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">16</span>), it.next());
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, it.next());</code></pre></div><h2 id="example-repeating-a-search-for-the-same-needle"><a class="doc-anchor" href="#example-repeating-a-search-for-the-same-needle">§</a>Example: repeating a search for the same needle</h2>
<p>It may be possible for the overhead of constructing a substring searcher to be
measurable in some workloads. In cases where the same needle is used to search
many haystacks, it is possible to do construction once and thus to avoid it for
subsequent searches. This can be done with a <a href="memmem/struct.Finder.html" title="struct memchr::memmem::Finder"><code>memmem::Finder</code></a>:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memchr::memmem;
<span class="kw">let </span>finder = memmem::Finder::new(<span class="string">"foo"</span>);
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">4</span>), finder.find(<span class="string">b"baz foo quux"</span>));
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, finder.find(<span class="string">b"quux baz bar"</span>));</code></pre></div><h2 id="why-use-this-crate"><a class="doc-anchor" href="#why-use-this-crate">§</a>Why use this crate?</h2>
<p>At first glance, the APIs provided by this crate might seem weird. Why provide
a dedicated routine like <code>memchr</code> for something that could be implemented
clearly and trivially in one line:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">fn </span>memchr(needle: u8, haystack: <span class="kw-2">&amp;</span>[u8]) -&gt; <span class="prelude-ty">Option</span>&lt;usize&gt; {
haystack.iter().position(|<span class="kw-2">&amp;</span>b| b == needle)
}</code></pre></div>
<p>Or similarly, why does this crate provide substring search routines when Rusts
core library already provides them?</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">fn </span>search(haystack: <span class="kw-2">&amp;</span>str, needle: <span class="kw-2">&amp;</span>str) -&gt; <span class="prelude-ty">Option</span>&lt;usize&gt; {
haystack.find(needle)
}</code></pre></div>
<p>The primary reason for both of them to exist is performance. When it comes to
performance, at a high level at least, there are two primary ways to look at
it:</p>
<ul>
<li><strong>Throughput</strong>: For this, think about it as, “given some very large haystack
and a byte that never occurs in that haystack, how long does it take to
search through it and determine that it, in fact, does not occur?”</li>
<li><strong>Latency</strong>: For this, think about it as, “given a tiny haystack—just a
few bytes—how long does it take to determine if a byte is in it?”</li>
</ul>
<p>The <code>memchr</code> routine in this crate has <em>slightly</em> worse latency than the
solution presented above, however, its throughput can easily be over an
order of magnitude faster. This is a good general purpose trade off to make.
You rarely lose, but often gain big.</p>
<p><strong>NOTE:</strong> The name <code>memchr</code> comes from the corresponding routine in <code>libc</code>. A
key advantage of using this library is that its performance is not tied to its
quality of implementation in the <code>libc</code> you happen to be using, which can vary
greatly from platform to platform.</p>
<p>But what about substring search? This one is a bit more complicated. The
primary reason for its existence is still indeed performance, but its also
useful because Rusts core library doesnt actually expose any substring
search routine on arbitrary bytes. The only substring search routine that
exists works exclusively on valid UTF-8.</p>
<p>So if you have valid UTF-8, is there a reason to use this over the standard
library substring search routine? Yes. This routine is faster on almost every
metric, including latency. The natural question then, is why isnt this
implementation in the standard library, even if only for searching on UTF-8?
The reason is that the implementation details for using SIMD in the standard
library havent quite been worked out yet.</p>
<p><strong>NOTE:</strong> Currently, only <code>x86_64</code>, <code>wasm32</code> and <code>aarch64</code> targets have vector
accelerated implementations of <code>memchr</code> (and friends) and <code>memmem</code>.</p>
<h2 id="crate-features"><a class="doc-anchor" href="#crate-features">§</a>Crate features</h2>
<ul>
<li><strong>std</strong> - When enabled (the default), this will permit features specific to
the standard library. Currently, the only thing used from the standard library
is runtime SIMD CPU feature detection. This means that this feature must be
enabled to get AVX2 accelerated routines on <code>x86_64</code> targets without enabling
the <code>avx2</code> feature at compile time, for example. When <code>std</code> is not enabled,
this crate will still attempt to use SSE2 accelerated routines on <code>x86_64</code>. It
will also use AVX2 accelerated routines when the <code>avx2</code> feature is enabled at
compile time. In general, enable this feature if you can.</li>
<li><strong>alloc</strong> - When enabled (the default), APIs in this crate requiring some
kind of allocation will become available. For example, the
<a href="memmem/struct.Finder.html#method.into_owned" title="method memchr::memmem::Finder::into_owned"><code>memmem::Finder::into_owned</code></a> API and the
<a href="arch/all/shiftor/index.html" title="mod memchr::arch::all::shiftor"><code>arch::all::shiftor</code></a> substring search
implementation. Otherwise, this crate is designed from the ground up to be
usable in core-only contexts, so the <code>alloc</code> feature doesnt add much
currently. Notably, disabling <code>std</code> but enabling <code>alloc</code> will <strong>not</strong> result
in the use of AVX2 on <code>x86_64</code> targets unless the <code>avx2</code> feature is enabled
at compile time. (With <code>std</code> enabled, AVX2 can be used even without the <code>avx2</code>
feature enabled at compile time by way of runtime CPU feature detection.)</li>
<li><strong>logging</strong> - When enabled (disabled by default), the <code>log</code> crate is used
to emit log messages about what kinds of <code>memchr</code> and <code>memmem</code> algorithms
are used. Namely, both <code>memchr</code> and <code>memmem</code> have a number of different
implementation choices depending on the target and CPU, and the log messages
can help show what specific implementations are being used. Generally, this is
useful for debugging performance issues.</li>
<li><strong>libc</strong> - <strong>DEPRECATED</strong>. Previously, this enabled the use of the targets
<code>memchr</code> function from whatever <code>libc</code> was linked into the program. This
feature is now a no-op because this crates implementation of <code>memchr</code> should
now be sufficiently fast on a number of platforms that <code>libc</code> should no longer
be needed. (This feature is somewhat of a holdover from this crates origins.
Originally, this crate was literally just a safe wrapper function around the
<code>memchr</code> function from <code>libc</code>.)</li>
</ul>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="arch/index.html" title="mod memchr::arch">arch</a></dt><dd>A module with low-level architecture dependent routines.</dd><dt><a class="mod" href="memmem/index.html" title="mod memchr::memmem">memmem</a></dt><dd>This module provides forward and reverse substring search routines.</dd></dl><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.Memchr.html" title="struct memchr::Memchr">Memchr</a></dt><dd>An iterator over all occurrences of a single byte in a haystack.</dd><dt><a class="struct" href="struct.Memchr2.html" title="struct memchr::Memchr2">Memchr2</a></dt><dd>An iterator over all occurrences of two possible bytes in a haystack.</dd><dt><a class="struct" href="struct.Memchr3.html" title="struct memchr::Memchr3">Memchr3</a></dt><dd>An iterator over all occurrences of three possible bytes in a haystack.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.memchr.html" title="fn memchr::memchr">memchr</a></dt><dd>Search for the first occurrence of a byte in a slice.</dd><dt><a class="fn" href="fn.memchr2.html" title="fn memchr::memchr2">memchr2</a></dt><dd>Search for the first occurrence of two possible bytes in a haystack.</dd><dt><a class="fn" href="fn.memchr3.html" title="fn memchr::memchr3">memchr3</a></dt><dd>Search for the first occurrence of three possible bytes in a haystack.</dd><dt><a class="fn" href="fn.memchr2_iter.html" title="fn memchr::memchr2_iter">memchr2_<wbr>iter</a></dt><dd>Returns an iterator over all occurrences of the needles in a haystack.</dd><dt><a class="fn" href="fn.memchr3_iter.html" title="fn memchr::memchr3_iter">memchr3_<wbr>iter</a></dt><dd>Returns an iterator over all occurrences of the needles in a haystack.</dd><dt><a class="fn" href="fn.memchr_iter.html" title="fn memchr::memchr_iter">memchr_<wbr>iter</a></dt><dd>Returns an iterator over all occurrences of the needle in a haystack.</dd><dt><a class="fn" href="fn.memrchr.html" title="fn memchr::memrchr">memrchr</a></dt><dd>Search for the last occurrence of a byte in a slice.</dd><dt><a class="fn" href="fn.memrchr2.html" title="fn memchr::memrchr2">memrchr2</a></dt><dd>Search for the last occurrence of two possible bytes in a haystack.</dd><dt><a class="fn" href="fn.memrchr3.html" title="fn memchr::memrchr3">memrchr3</a></dt><dd>Search for the last occurrence of three possible bytes in a haystack.</dd><dt><a class="fn" href="fn.memrchr2_iter.html" title="fn memchr::memrchr2_iter">memrchr2_<wbr>iter</a></dt><dd>Returns an iterator over all occurrences of the needles in a haystack, in
reverse.</dd><dt><a class="fn" href="fn.memrchr3_iter.html" title="fn memchr::memrchr3_iter">memrchr3_<wbr>iter</a></dt><dd>Returns an iterator over all occurrences of the needles in a haystack, in
reverse.</dd><dt><a class="fn" href="fn.memrchr_iter.html" title="fn memchr::memrchr_iter">memrchr_<wbr>iter</a></dt><dd>Returns an iterator over all occurrences of the needle in a haystack, in
reverse.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../memchr/fn.memchr.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../memchr/fn.memchr.html">../../memchr/fn.memchr.html</a>...</p>
<script>location.replace("../../memchr/fn.memchr.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../memchr/fn.memchr2.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../memchr/fn.memchr2.html">../../memchr/fn.memchr2.html</a>...</p>
<script>location.replace("../../memchr/fn.memchr2.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../memchr/fn.memchr2_iter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../memchr/fn.memchr2_iter.html">../../memchr/fn.memchr2_iter.html</a>...</p>
<script>location.replace("../../memchr/fn.memchr2_iter.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../memchr/fn.memchr3.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../memchr/fn.memchr3.html">../../memchr/fn.memchr3.html</a>...</p>
<script>location.replace("../../memchr/fn.memchr3.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../memchr/fn.memchr3_iter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../memchr/fn.memchr3_iter.html">../../memchr/fn.memchr3_iter.html</a>...</p>
<script>location.replace("../../memchr/fn.memchr3_iter.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../memchr/fn.memchr_iter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../memchr/fn.memchr_iter.html">../../memchr/fn.memchr_iter.html</a>...</p>
<script>location.replace("../../memchr/fn.memchr_iter.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../memchr/fn.memrchr.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../memchr/fn.memrchr.html">../../memchr/fn.memrchr.html</a>...</p>
<script>location.replace("../../memchr/fn.memrchr.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../memchr/fn.memrchr2.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../memchr/fn.memrchr2.html">../../memchr/fn.memrchr2.html</a>...</p>
<script>location.replace("../../memchr/fn.memrchr2.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../memchr/fn.memrchr2_iter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../memchr/fn.memrchr2_iter.html">../../memchr/fn.memrchr2_iter.html</a>...</p>
<script>location.replace("../../memchr/fn.memrchr2_iter.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../memchr/fn.memrchr3.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../memchr/fn.memrchr3.html">../../memchr/fn.memrchr3.html</a>...</p>
<script>location.replace("../../memchr/fn.memrchr3.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../memchr/fn.memrchr3_iter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../memchr/fn.memrchr3_iter.html">../../memchr/fn.memrchr3_iter.html</a>...</p>
<script>location.replace("../../memchr/fn.memrchr3_iter.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../memchr/fn.memrchr_iter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../memchr/fn.memrchr_iter.html">../../memchr/fn.memrchr_iter.html</a>...</p>
<script>location.replace("../../memchr/fn.memrchr_iter.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../memchr/struct.Memchr.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../memchr/struct.Memchr.html">../../memchr/struct.Memchr.html</a>...</p>
<script>location.replace("../../memchr/struct.Memchr.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../memchr/struct.Memchr2.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../memchr/struct.Memchr2.html">../../memchr/struct.Memchr2.html</a>...</p>
<script>location.replace("../../memchr/struct.Memchr2.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../memchr/struct.Memchr3.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../memchr/struct.Memchr3.html">../../memchr/struct.Memchr3.html</a>...</p>
<script>location.replace("../../memchr/struct.Memchr3.html" + location.search + location.hash);</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,19 @@
<!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="Returns the index of the first occurrence of the given needle."><title>find in memchr::memmem - 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"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">find</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">find</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#complexity" title="Complexity">Complexity</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In memchr::<wbr>memmem</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">memchr</a>::<wbr><a href="index.html">memmem</a></div><h1>Function <span class="fn">find</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/memchr/memmem/mod.rs.html#185-191">Source</a> </span></div><pre class="rust item-decl"><code>pub fn find(haystack: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>], needle: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns the index of the first occurrence of the given needle.</p>
<p>Note that if youre are searching for the same needle in many different
small haystacks, it may be faster to initialize a <a href="struct.Finder.html" title="struct memchr::memmem::Finder"><code>Finder</code></a> once,
and reuse it for each search.</p>
<h2 id="complexity"><a class="doc-anchor" href="#complexity">§</a>Complexity</h2>
<p>This routine is guaranteed to have worst case linear time complexity
with respect to both the needle and the haystack. That is, this runs
in <code>O(needle.len() + haystack.len())</code> time.</p>
<p>This routine is also guaranteed to have worst case constant space
complexity.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<p>Basic usage:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memchr::memmem;
<span class="kw">let </span>haystack = <span class="string">b"foo bar baz"</span>;
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">0</span>), memmem::find(haystack, <span class="string">b"foo"</span>));
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">4</span>), memmem::find(haystack, <span class="string">b"bar"</span>));
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, memmem::find(haystack, <span class="string">b"quux"</span>));</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,22 @@
<!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="Returns an iterator over all non-overlapping occurrences of a substring in a haystack."><title>find_iter in memchr::memmem - 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"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">find_iter</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">find_<wbr>iter</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#complexity" title="Complexity">Complexity</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In memchr::<wbr>memmem</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">memchr</a>::<wbr><a href="index.html">memmem</a></div><h1>Function <span class="fn">find_<wbr>iter</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/memchr/memmem/mod.rs.html#116-121">Source</a> </span></div><pre class="rust item-decl"><code>pub fn find_iter&lt;'h, 'n, N: 'n + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]&gt;&gt;(
haystack: &amp;'h [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>],
needle: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;'n N</a>,
) -&gt; <a class="struct" href="struct.FindIter.html" title="struct memchr::memmem::FindIter">FindIter</a>&lt;'h, 'n&gt; <a href="#" class="tooltip" data-notable-ty="FindIter&lt;&#39;h, &#39;n&gt;"></a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns an iterator over all non-overlapping occurrences of a substring in
a haystack.</p>
<h2 id="complexity"><a class="doc-anchor" href="#complexity">§</a>Complexity</h2>
<p>This routine is guaranteed to have worst case linear time complexity
with respect to both the needle and the haystack. That is, this runs
in <code>O(needle.len() + haystack.len())</code> time.</p>
<p>This routine is also guaranteed to have worst case constant space
complexity.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<p>Basic usage:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memchr::memmem;
<span class="kw">let </span>haystack = <span class="string">b"foo bar foo baz foo"</span>;
<span class="kw">let </span><span class="kw-2">mut </span>it = memmem::find_iter(haystack, <span class="string">b"foo"</span>);
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">0</span>), it.next());
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">8</span>), it.next());
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">16</span>), it.next());
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, it.next());</code></pre></div></div></details><script type="text/json" id="notable-traits-data">{"FindIter<'h, 'n>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.FindIter.html\" title=\"struct memchr::memmem::FindIter\">FindIter</a>&lt;'h, 'n&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'h, 'n&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"struct.FindIter.html\" title=\"struct memchr::memmem::FindIter\">FindIter</a>&lt;'h, 'n&gt;</div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = <a class=\"primitive\" href=\"https://doc.rust-lang.org/1.93.1/std/primitive.usize.html\">usize</a>;</div>"}</script></section></div></main></body></html>

View File

@@ -0,0 +1,20 @@
<!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="Returns the index of the last occurrence of the given needle."><title>rfind in memchr::memmem - 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"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">rfind</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">rfind</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#complexity" title="Complexity">Complexity</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In memchr::<wbr>memmem</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">memchr</a>::<wbr><a href="index.html">memmem</a></div><h1>Function <span class="fn">rfind</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/memchr/memmem/mod.rs.html#222-228">Source</a> </span></div><pre class="rust item-decl"><code>pub fn rfind(haystack: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>], needle: &amp;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.usize.html">usize</a>&gt;</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns the index of the last occurrence of the given needle.</p>
<p>Note that if youre are searching for the same needle in many different
small haystacks, it may be faster to initialize a <a href="struct.FinderRev.html" title="struct memchr::memmem::FinderRev"><code>FinderRev</code></a> once,
and reuse it for each search.</p>
<h2 id="complexity"><a class="doc-anchor" href="#complexity">§</a>Complexity</h2>
<p>This routine is guaranteed to have worst case linear time complexity
with respect to both the needle and the haystack. That is, this runs
in <code>O(needle.len() + haystack.len())</code> time.</p>
<p>This routine is also guaranteed to have worst case constant space
complexity.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<p>Basic usage:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memchr::memmem;
<span class="kw">let </span>haystack = <span class="string">b"foo bar baz"</span>;
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">0</span>), memmem::rfind(haystack, <span class="string">b"foo"</span>));
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">4</span>), memmem::rfind(haystack, <span class="string">b"bar"</span>));
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">8</span>), memmem::rfind(haystack, <span class="string">b"ba"</span>));
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, memmem::rfind(haystack, <span class="string">b"quux"</span>));</code></pre></div></div></details></section></div></main></body></html>

View File

@@ -0,0 +1,22 @@
<!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="Returns a reverse iterator over all non-overlapping occurrences of a substring in a haystack."><title>rfind_iter in memchr::memmem - 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"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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="#">rfind_iter</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">rfind_<wbr>iter</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#complexity" title="Complexity">Complexity</a></li><li><a href="#examples" title="Examples">Examples</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="index.html">In memchr::<wbr>memmem</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">memchr</a>::<wbr><a href="index.html">memmem</a></div><h1>Function <span class="fn">rfind_<wbr>iter</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/memchr/memmem/mod.rs.html#150-155">Source</a> </span></div><pre class="rust item-decl"><code>pub fn rfind_iter&lt;'h, 'n, N: 'n + ?<a class="trait" href="https://doc.rust-lang.org/1.93.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + <a class="trait" href="https://doc.rust-lang.org/1.93.1/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>]&gt;&gt;(
haystack: &amp;'h [<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.u8.html">u8</a>],
needle: <a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.reference.html">&amp;'n N</a>,
) -&gt; <a class="struct" href="struct.FindRevIter.html" title="struct memchr::memmem::FindRevIter">FindRevIter</a>&lt;'h, 'n&gt; <a href="#" class="tooltip" data-notable-ty="FindRevIter&lt;&#39;h, &#39;n&gt;"></a></code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Returns a reverse iterator over all non-overlapping occurrences of a
substring in a haystack.</p>
<h2 id="complexity"><a class="doc-anchor" href="#complexity">§</a>Complexity</h2>
<p>This routine is guaranteed to have worst case linear time complexity
with respect to both the needle and the haystack. That is, this runs
in <code>O(needle.len() + haystack.len())</code> time.</p>
<p>This routine is also guaranteed to have worst case constant space
complexity.</p>
<h2 id="examples"><a class="doc-anchor" href="#examples">§</a>Examples</h2>
<p>Basic usage:</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memchr::memmem;
<span class="kw">let </span>haystack = <span class="string">b"foo bar foo baz foo"</span>;
<span class="kw">let </span><span class="kw-2">mut </span>it = memmem::rfind_iter(haystack, <span class="string">b"foo"</span>);
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">16</span>), it.next());
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">8</span>), it.next());
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">0</span>), it.next());
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, it.next());</code></pre></div></div></details><script type="text/json" id="notable-traits-data">{"FindRevIter<'h, 'n>":"<h3>Notable traits for <code><a class=\"struct\" href=\"struct.FindRevIter.html\" title=\"struct memchr::memmem::FindRevIter\">FindRevIter</a>&lt;'h, 'n&gt;</code></h3><pre><code><div class=\"where\">impl&lt;'h, 'n&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"struct.FindRevIter.html\" title=\"struct memchr::memmem::FindRevIter\">FindRevIter</a>&lt;'h, 'n&gt;</div><div class=\"where\"> type <a href=\"https://doc.rust-lang.org/1.93.1/core/iter/traits/iterator/trait.Iterator.html#associatedtype.Item\" class=\"associatedtype\">Item</a> = <a class=\"primitive\" href=\"https://doc.rust-lang.org/1.93.1/std/primitive.usize.html\">usize</a>;</div>"}</script></section></div></main></body></html>

View File

@@ -0,0 +1,50 @@
<!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="This module provides forward and reverse substring search routines."><title>memchr::memmem - 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"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="memchr" data-themes="" data-resource-suffix="" data-rustdoc-version="1.93.1 (01f6ddf75 2026-02-11) (Arch Linux rust 1:1.93.1-1)" data-channel="1.93.1" data-search-js="search-9e2438ea.js" data-stringdex-js="stringdex-a3946164.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-a410ff4d.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 mod"><!--[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="#">Module memmem</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../memchr/index.html">memchr</a><span class="version">2.8.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module memmem</a></h2><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#example-iterating-over-substring-matches" title="Example: iterating over substring matches">Example: iterating over substring matches</a></li><li><a href="#example-iterating-over-substring-matches-in-reverse" title="Example: iterating over substring matches in reverse">Example: iterating over substring matches in reverse</a></li><li><a href="#example-repeating-a-search-for-the-same-needle" title="Example: repeating a search for the same needle">Example: repeating a search for the same needle</a></li></ul><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate memchr</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">memchr</a></div><h1>Module <span>memmem</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/memchr/memmem/mod.rs.html#1-776">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>This module provides forward and reverse substring search routines.</p>
<p>Unlike the standard librarys substring search routines, these work on
arbitrary bytes. For all non-empty needles, these routines will report exactly
the same values as the corresponding routines in the standard library. For
the empty needle, the standard library reports matches only at valid UTF-8
boundaries, where as these routines will report matches at every position.</p>
<p>Other than being able to work on arbitrary bytes, the primary reason to prefer
these routines over the standard library routines is that these will generally
be faster. In some cases, significantly so.</p>
<h2 id="example-iterating-over-substring-matches"><a class="doc-anchor" href="#example-iterating-over-substring-matches">§</a>Example: iterating over substring matches</h2>
<p>This example shows how to use <a href="fn.find_iter.html" title="fn memchr::memmem::find_iter"><code>find_iter</code></a> to find occurrences of a substring
in a haystack.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memchr::memmem;
<span class="kw">let </span>haystack = <span class="string">b"foo bar foo baz foo"</span>;
<span class="kw">let </span><span class="kw-2">mut </span>it = memmem::find_iter(haystack, <span class="string">"foo"</span>);
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">0</span>), it.next());
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">8</span>), it.next());
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">16</span>), it.next());
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, it.next());</code></pre></div><h2 id="example-iterating-over-substring-matches-in-reverse"><a class="doc-anchor" href="#example-iterating-over-substring-matches-in-reverse">§</a>Example: iterating over substring matches in reverse</h2>
<p>This example shows how to use <a href="fn.rfind_iter.html" title="fn memchr::memmem::rfind_iter"><code>rfind_iter</code></a> to find occurrences of a substring
in a haystack starting from the end of the haystack.</p>
<p><strong>NOTE:</strong> This module does not implement double ended iterators, so reverse
searches arent done by calling <code>rev</code> on a forward iterator.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memchr::memmem;
<span class="kw">let </span>haystack = <span class="string">b"foo bar foo baz foo"</span>;
<span class="kw">let </span><span class="kw-2">mut </span>it = memmem::rfind_iter(haystack, <span class="string">"foo"</span>);
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">16</span>), it.next());
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">8</span>), it.next());
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">0</span>), it.next());
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, it.next());</code></pre></div><h2 id="example-repeating-a-search-for-the-same-needle"><a class="doc-anchor" href="#example-repeating-a-search-for-the-same-needle">§</a>Example: repeating a search for the same needle</h2>
<p>It may be possible for the overhead of constructing a substring searcher to be
measurable in some workloads. In cases where the same needle is used to search
many haystacks, it is possible to do construction once and thus to avoid it for
subsequent searches. This can be done with a <a href="struct.Finder.html" title="struct memchr::memmem::Finder"><code>Finder</code></a> (or a <a href="struct.FinderRev.html" title="struct memchr::memmem::FinderRev"><code>FinderRev</code></a> for
reverse searches).</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>memchr::memmem;
<span class="kw">let </span>finder = memmem::Finder::new(<span class="string">"foo"</span>);
<span class="macro">assert_eq!</span>(<span class="prelude-val">Some</span>(<span class="number">4</span>), finder.find(<span class="string">b"baz foo quux"</span>));
<span class="macro">assert_eq!</span>(<span class="prelude-val">None</span>, finder.find(<span class="string">b"quux baz bar"</span>));</code></pre></div></div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><dl class="item-table"><dt><a class="struct" href="struct.FindIter.html" title="struct memchr::memmem::FindIter">Find<wbr>Iter</a></dt><dd>An iterator over non-overlapping substring matches.</dd><dt><a class="struct" href="struct.FindRevIter.html" title="struct memchr::memmem::FindRevIter">Find<wbr>RevIter</a></dt><dd>An iterator over non-overlapping substring matches in reverse.</dd><dt><a class="struct" href="struct.Finder.html" title="struct memchr::memmem::Finder">Finder</a></dt><dd>A single substring searcher fixed to a particular needle.</dd><dt><a class="struct" href="struct.FinderBuilder.html" title="struct memchr::memmem::FinderBuilder">Finder<wbr>Builder</a></dt><dd>A builder for constructing non-default forward or reverse memmem finders.</dd><dt><a class="struct" href="struct.FinderRev.html" title="struct memchr::memmem::FinderRev">Finder<wbr>Rev</a></dt><dd>A single substring reverse searcher fixed to a particular needle.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.Prefilter.html" title="enum memchr::memmem::Prefilter">Prefilter</a></dt><dd>Prefilter controls whether heuristics are used to accelerate searching.</dd></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.find.html" title="fn memchr::memmem::find">find</a></dt><dd>Returns the index of the first occurrence of the given needle.</dd><dt><a class="fn" href="fn.find_iter.html" title="fn memchr::memmem::find_iter">find_<wbr>iter</a></dt><dd>Returns an iterator over all non-overlapping occurrences of a substring in
a haystack.</dd><dt><a class="fn" href="fn.rfind.html" title="fn memchr::memmem::rfind">rfind</a></dt><dd>Returns the index of the last occurrence of the given needle.</dd><dt><a class="fn" href="fn.rfind_iter.html" title="fn memchr::memmem::rfind_iter">rfind_<wbr>iter</a></dt><dd>Returns a reverse iterator over all non-overlapping occurrences of a
substring in a haystack.</dd></dl></section></div></main></body></html>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../../memchr/memmem/enum.Prefilter.html">
<title>Redirection</title>
</head>
<body>
<p>Redirecting to <a href="../../../memchr/memmem/enum.Prefilter.html">../../../memchr/memmem/enum.Prefilter.html</a>...</p>
<script>location.replace("../../../memchr/memmem/enum.Prefilter.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1 @@
window.SIDEBAR_ITEMS = {"enum":["Prefilter"],"fn":["find","find_iter","rfind","rfind_iter"],"struct":["FindIter","FindRevIter","Finder","FinderBuilder","FinderRev"]};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More