Files
phy/regex/bytes/trait.Replacer.html
Orion Kindel 0ce894e6b0 doc
2025-03-18 10:30:23 -05:00

65 lines
28 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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 trait for types that can be used to replace matches in a haystack."><title>Replacer in regex::bytes - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="regex" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0 (9fc6b4312 2025-01-07)" data-channel="1.84.0" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.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]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../regex/index.html">regex</a><span class="version">1.11.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Replacer</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.replace_append" title="replace_append">replace_append</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.by_ref" title="by_ref">by_ref</a></li><li><a href="#method.no_expansion" title="no_expansion">no_expansion</a></li></ul><h3><a href="#foreign-impls">Implementations on Foreign Types</a></h3><ul class="block"><li><a href="#impl-Replacer-for-%26Cow%3C'a,+%5Bu8%5D%3E" title="&#38;&#39;a Cow&#60;&#39;a, [u8]&#62;">&#38;&#39;a Cow&#60;&#39;a, [u8]&#62;</a></li><li><a href="#impl-Replacer-for-%26Vec%3Cu8%3E" title="&#38;&#39;a Vec&#60;u8&#62;">&#38;&#39;a Vec&#60;u8&#62;</a></li><li><a href="#impl-Replacer-for-%26%5Bu8;+N%5D" title="&#38;&#39;a [u8; N]">&#38;&#39;a [u8; N]</a></li><li><a href="#impl-Replacer-for-%26%5Bu8%5D" title="&#38;&#39;a [u8]">&#38;&#39;a [u8]</a></li><li><a href="#impl-Replacer-for-Cow%3C'a,+%5Bu8%5D%3E" title="Cow&#60;&#39;a, [u8]&#62;">Cow&#60;&#39;a, [u8]&#62;</a></li><li><a href="#impl-Replacer-for-Vec%3Cu8%3E" title="Vec&#60;u8&#62;">Vec&#60;u8&#62;</a></li><li><a href="#impl-Replacer-for-%5Bu8;+N%5D" title="[u8; N]">[u8; N]</a></li></ul><h3><a href="#dyn-compatibility">Dyn Compatibility</a></h3><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In regex::<wbr>bytes</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">regex</a>::<wbr><a href="index.html">bytes</a></span><h1>Trait <span class="trait">Replacer</span><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/regex/regex/bytes.rs.html#2423-2470">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Replacer {
// Required method
fn <a href="#tymethod.replace_append" class="fn">replace_append</a>(&amp;mut self, caps: &amp;<a class="struct" href="struct.Captures.html" title="struct regex::bytes::Captures">Captures</a>&lt;'_&gt;, dst: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.84.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>&gt;);
// Provided methods
fn <a href="#method.no_expansion" class="fn">no_expansion</a>&lt;'r&gt;(&amp;'r mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.84.0/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'r, [<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>]&gt;&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.by_ref" class="fn">by_ref</a>&lt;'r&gt;(&amp;'r mut self) -&gt; <a class="struct" href="struct.ReplacerRef.html" title="struct regex::bytes::ReplacerRef">ReplacerRef</a>&lt;'r, Self&gt; { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A trait for types that can be used to replace matches in a haystack.</p>
<p>In general, users of this crate shouldnt need to implement this trait,
since implementations are already provided for <code>&amp;[u8]</code> along with other
variants of byte string types, as well as <code>FnMut(&amp;Captures) -&gt; Vec&lt;u8&gt;</code> (or
any <code>FnMut(&amp;Captures) -&gt; T</code> where <code>T: AsRef&lt;[u8]&gt;</code>). Those cover most use
cases, but callers can implement this trait directly if necessary.</p>
<h2 id="example"><a class="doc-anchor" href="#example">§</a>Example</h2>
<p>This example shows a basic implementation of the <code>Replacer</code> trait. This can
be done much more simply using the replacement byte string interpolation
support (e.g., <code>$first $last</code>), but this approach avoids needing to parse
the replacement byte string at all.</p>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>regex::bytes::{Captures, Regex, Replacer};
<span class="kw">struct </span>NameSwapper;
<span class="kw">impl </span>Replacer <span class="kw">for </span>NameSwapper {
<span class="kw">fn </span>replace_append(<span class="kw-2">&amp;mut </span><span class="self">self</span>, caps: <span class="kw-2">&amp;</span>Captures&lt;<span class="lifetime">'_</span>&gt;, dst: <span class="kw-2">&amp;mut </span>Vec&lt;u8&gt;) {
dst.extend_from_slice(<span class="kw-2">&amp;</span>caps[<span class="string">"first"</span>]);
dst.extend_from_slice(<span class="string">b" "</span>);
dst.extend_from_slice(<span class="kw-2">&amp;</span>caps[<span class="string">"last"</span>]);
}
}
<span class="kw">let </span>re = Regex::new(<span class="string">r"(?&lt;last&gt;[^,\s]+),\s+(?&lt;first&gt;\S+)"</span>).unwrap();
<span class="kw">let </span>result = re.replace(<span class="string">b"Springsteen, Bruce"</span>, NameSwapper);
<span class="macro">assert_eq!</span>(result, <span class="kw-2">&amp;</span><span class="string">b"Bruce Springsteen"</span>[..]);</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.replace_append" class="method"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2431">Source</a><h4 class="code-header">fn <a href="#tymethod.replace_append" class="fn">replace_append</a>(&amp;mut self, caps: &amp;<a class="struct" href="struct.Captures.html" title="struct regex::bytes::Captures">Captures</a>&lt;'_&gt;, dst: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.84.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>&gt;)</h4></section></summary><div class="docblock"><p>Appends possibly empty data to <code>dst</code> to replace the current match.</p>
<p>The current match is represented by <code>caps</code>, which is guaranteed to have
a match at capture group <code>0</code>.</p>
<p>For example, a no-op replacement would be
<code>dst.extend_from_slice(&amp;caps[0])</code>.</p>
</div></details></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="method.no_expansion" class="method"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2441-2443">Source</a><h4 class="code-header">fn <a href="#method.no_expansion" class="fn">no_expansion</a>&lt;'r&gt;(&amp;'r mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.84.0/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'r, [<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>]&gt;&gt;</h4></section></summary><div class="docblock"><p>Return a fixed unchanging replacement byte string.</p>
<p>When doing replacements, if access to <a href="struct.Captures.html" title="struct regex::bytes::Captures"><code>Captures</code></a> is not needed (e.g.,
the replacement byte string does not need <code>$</code> expansion), then it can
be beneficial to avoid finding sub-captures.</p>
<p>In general, this is called once for every call to a replacement routine
such as <a href="struct.Regex.html#method.replace_all" title="method regex::bytes::Regex::replace_all"><code>Regex::replace_all</code></a>.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.by_ref" class="method"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2467-2469">Source</a><h4 class="code-header">fn <a href="#method.by_ref" class="fn">by_ref</a>&lt;'r&gt;(&amp;'r mut self) -&gt; <a class="struct" href="struct.ReplacerRef.html" title="struct regex::bytes::ReplacerRef">ReplacerRef</a>&lt;'r, Self&gt;</h4></section></summary><div class="docblock"><p>Returns a type that implements <code>Replacer</code>, but that borrows and wraps
this <code>Replacer</code>.</p>
<p>This is useful when you want to take a generic <code>Replacer</code> (which might
not be cloneable) and use it without consuming it, so it can be used
more than once.</p>
<h5 id="example-1"><a class="doc-anchor" href="#example-1">§</a>Example</h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>regex::bytes::{Regex, Replacer};
<span class="kw">fn </span>replace_all_twice&lt;R: Replacer&gt;(
re: Regex,
src: <span class="kw-2">&amp;</span>[u8],
<span class="kw-2">mut </span>rep: R,
) -&gt; Vec&lt;u8&gt; {
<span class="kw">let </span>dst = re.replace_all(src, rep.by_ref());
<span class="kw">let </span>dst = re.replace_all(<span class="kw-2">&amp;</span>dst, rep.by_ref());
dst.into_owned()
}</code></pre></div>
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait is <b>not</b> <a href="https://doc.rust-lang.org/1.84.0/reference/items/traits.html#object-safety">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.</i></p></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-Replacer-for-Vec%3Cu8%3E" class="impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2512-2520">Source</a><a href="#impl-Replacer-for-Vec%3Cu8%3E" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Replacer.html" title="trait regex::bytes::Replacer">Replacer</a> for <a class="struct" href="https://doc.rust-lang.org/1.84.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>&gt;</h3></section></summary><div class="impl-items"><section id="method.replace_append" class="method trait-impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2513-2515">Source</a><a href="#method.replace_append" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.replace_append" class="fn">replace_append</a>(&amp;mut self, caps: &amp;<a class="struct" href="struct.Captures.html" title="struct regex::bytes::Captures">Captures</a>&lt;'_&gt;, dst: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.84.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>&gt;)</h4></section><section id="method.no_expansion-1" class="method trait-impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2517-2519">Source</a><a href="#method.no_expansion-1" class="anchor">§</a><h4 class="code-header">fn <a href="#method.no_expansion" class="fn">no_expansion</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.84.0/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'_, [<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>]&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Replacer-for-%26Cow%3C'a,+%5Bu8%5D%3E" class="impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2532-2540">Source</a><a href="#impl-Replacer-for-%26Cow%3C'a,+%5Bu8%5D%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="trait.Replacer.html" title="trait regex::bytes::Replacer">Replacer</a> for &amp;'a <a class="enum" href="https://doc.rust-lang.org/1.84.0/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'a, [<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>]&gt;</h3></section></summary><div class="impl-items"><section id="method.replace_append-1" class="method trait-impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2533-2535">Source</a><a href="#method.replace_append-1" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.replace_append" class="fn">replace_append</a>(&amp;mut self, caps: &amp;<a class="struct" href="struct.Captures.html" title="struct regex::bytes::Captures">Captures</a>&lt;'_&gt;, dst: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.84.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>&gt;)</h4></section><section id="method.no_expansion-2" class="method trait-impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2537-2539">Source</a><a href="#method.no_expansion-2" class="anchor">§</a><h4 class="code-header">fn <a href="#method.no_expansion" class="fn">no_expansion</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.84.0/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'_, [<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>]&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Replacer-for-%26Vec%3Cu8%3E" class="impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2502-2510">Source</a><a href="#impl-Replacer-for-%26Vec%3Cu8%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="trait.Replacer.html" title="trait regex::bytes::Replacer">Replacer</a> for &amp;'a <a class="struct" href="https://doc.rust-lang.org/1.84.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>&gt;</h3></section></summary><div class="impl-items"><section id="method.replace_append-2" class="method trait-impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2503-2505">Source</a><a href="#method.replace_append-2" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.replace_append" class="fn">replace_append</a>(&amp;mut self, caps: &amp;<a class="struct" href="struct.Captures.html" title="struct regex::bytes::Captures">Captures</a>&lt;'_&gt;, dst: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.84.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>&gt;)</h4></section><section id="method.no_expansion-3" class="method trait-impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2507-2509">Source</a><a href="#method.no_expansion-3" class="anchor">§</a><h4 class="code-header">fn <a href="#method.no_expansion" class="fn">no_expansion</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.84.0/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'_, [<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>]&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Replacer-for-%26%5Bu8%5D" class="impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2492-2500">Source</a><a href="#impl-Replacer-for-%26%5Bu8%5D" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="trait.Replacer.html" title="trait regex::bytes::Replacer">Replacer</a> for &amp;'a [<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>]</h3></section></summary><div class="impl-items"><section id="method.replace_append-3" class="method trait-impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2493-2495">Source</a><a href="#method.replace_append-3" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.replace_append" class="fn">replace_append</a>(&amp;mut self, caps: &amp;<a class="struct" href="struct.Captures.html" title="struct regex::bytes::Captures">Captures</a>&lt;'_&gt;, dst: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.84.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>&gt;)</h4></section><section id="method.no_expansion-4" class="method trait-impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2497-2499">Source</a><a href="#method.no_expansion-4" class="anchor">§</a><h4 class="code-header">fn <a href="#method.no_expansion" class="fn">no_expansion</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.84.0/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'_, [<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>]&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Replacer-for-Cow%3C'a,+%5Bu8%5D%3E" class="impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2522-2530">Source</a><a href="#impl-Replacer-for-Cow%3C'a,+%5Bu8%5D%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a&gt; <a class="trait" href="trait.Replacer.html" title="trait regex::bytes::Replacer">Replacer</a> for <a class="enum" href="https://doc.rust-lang.org/1.84.0/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'a, [<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>]&gt;</h3></section></summary><div class="impl-items"><section id="method.replace_append-4" class="method trait-impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2523-2525">Source</a><a href="#method.replace_append-4" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.replace_append" class="fn">replace_append</a>(&amp;mut self, caps: &amp;<a class="struct" href="struct.Captures.html" title="struct regex::bytes::Captures">Captures</a>&lt;'_&gt;, dst: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.84.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>&gt;)</h4></section><section id="method.no_expansion-5" class="method trait-impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2527-2529">Source</a><a href="#method.no_expansion-5" class="anchor">§</a><h4 class="code-header">fn <a href="#method.no_expansion" class="fn">no_expansion</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.84.0/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'_, [<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>]&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Replacer-for-%26%5Bu8;+N%5D" class="impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2472-2480">Source</a><a href="#impl-Replacer-for-%26%5Bu8;+N%5D" class="anchor">§</a><h3 class="code-header">impl&lt;'a, const N: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>&gt; <a class="trait" href="trait.Replacer.html" title="trait regex::bytes::Replacer">Replacer</a> for &amp;'a [<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.array.html">N</a>]</h3></section></summary><div class="impl-items"><section id="method.replace_append-5" class="method trait-impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2473-2475">Source</a><a href="#method.replace_append-5" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.replace_append" class="fn">replace_append</a>(&amp;mut self, caps: &amp;<a class="struct" href="struct.Captures.html" title="struct regex::bytes::Captures">Captures</a>&lt;'_&gt;, dst: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.84.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>&gt;)</h4></section><section id="method.no_expansion-6" class="method trait-impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2477-2479">Source</a><a href="#method.no_expansion-6" class="anchor">§</a><h4 class="code-header">fn <a href="#method.no_expansion" class="fn">no_expansion</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.84.0/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'_, [<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>]&gt;&gt;</h4></section></div></details><details class="toggle implementors-toggle"><summary><section id="impl-Replacer-for-%5Bu8;+N%5D" class="impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2482-2490">Source</a><a href="#impl-Replacer-for-%5Bu8;+N%5D" class="anchor">§</a><h3 class="code-header">impl&lt;const N: <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.usize.html">usize</a>&gt; <a class="trait" href="trait.Replacer.html" title="trait regex::bytes::Replacer">Replacer</a> for [<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>; <a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.array.html">N</a>]</h3></section></summary><div class="impl-items"><section id="method.replace_append-6" class="method trait-impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2483-2485">Source</a><a href="#method.replace_append-6" class="anchor">§</a><h4 class="code-header">fn <a href="#tymethod.replace_append" class="fn">replace_append</a>(&amp;mut self, caps: &amp;<a class="struct" href="struct.Captures.html" title="struct regex::bytes::Captures">Captures</a>&lt;'_&gt;, dst: &amp;mut <a class="struct" href="https://doc.rust-lang.org/1.84.0/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>&gt;)</h4></section><section id="method.no_expansion-7" class="method trait-impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2487-2489">Source</a><a href="#method.no_expansion-7" class="anchor">§</a><h4 class="code-header">fn <a href="#method.no_expansion" class="fn">no_expansion</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.84.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="https://doc.rust-lang.org/1.84.0/alloc/borrow/enum.Cow.html" title="enum alloc::borrow::Cow">Cow</a>&lt;'_, [<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>]&gt;&gt;</h4></section></div></details><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-Replacer-for-ReplacerRef%3C'a,+R%3E" class="impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2561-2569">Source</a><a href="#impl-Replacer-for-ReplacerRef%3C'a,+R%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'a, R: <a class="trait" href="trait.Replacer.html" title="trait regex::bytes::Replacer">Replacer</a> + ?<a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> + 'a&gt; <a class="trait" href="trait.Replacer.html" title="trait regex::bytes::Replacer">Replacer</a> for <a class="struct" href="struct.ReplacerRef.html" title="struct regex::bytes::ReplacerRef">ReplacerRef</a>&lt;'a, R&gt;</h3></section><section id="impl-Replacer-for-NoExpand%3C's%3E" class="impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2593-2601">Source</a><a href="#impl-Replacer-for-NoExpand%3C's%3E" class="anchor">§</a><h3 class="code-header">impl&lt;'s&gt; <a class="trait" href="trait.Replacer.html" title="trait regex::bytes::Replacer">Replacer</a> for <a class="struct" href="struct.NoExpand.html" title="struct regex::bytes::NoExpand">NoExpand</a>&lt;'s&gt;</h3></section><section id="impl-Replacer-for-F" class="impl"><a class="src rightside" href="../../src/regex/regex/bytes.rs.html#2542-2550">Source</a><a href="#impl-Replacer-for-F" class="anchor">§</a><h3 class="code-header">impl&lt;F, T&gt; <a class="trait" href="trait.Replacer.html" title="trait regex::bytes::Replacer">Replacer</a> for F<div class="where">where
F: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(&amp;<a class="struct" href="struct.Captures.html" title="struct regex::bytes::Captures">Captures</a>&lt;'_&gt;) -&gt; T,
T: <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/convert/trait.AsRef.html" title="trait core::convert::AsRef">AsRef</a>&lt;[<a class="primitive" href="https://doc.rust-lang.org/1.84.0/std/primitive.u8.html">u8</a>]&gt;,</div></h3></section></div><script src="../../trait.impl/regex/regex/bytes/trait.Replacer.js" data-ignore-extern-crates="std,alloc" async></script></section></div></main></body></html>