Files
GopherGate/target/doc/regex_syntax/hir/trait.Visitor.html
2026-02-26 12:00:21 -05:00

33 lines
14 KiB
HTML

<!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 visiting the high-level IR (HIR) in depth first order."><title>Visitor in regex_syntax::hir - 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="regex_syntax" 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="#">Visitor</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../regex_syntax/index.html">regex_<wbr>syntax</a><span class="version">0.8.10</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Visitor</a></h2><h3><a href="#required-associated-types">Required Associated Types</a></h3><ul class="block"><li><a href="#associatedtype.Err" title="Err">Err</a></li><li><a href="#associatedtype.Output" title="Output">Output</a></li></ul><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.finish" title="finish">finish</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.start" title="start">start</a></li><li><a href="#method.visit_alternation_in" title="visit_alternation_in">visit_alternation_in</a></li><li><a href="#method.visit_concat_in" title="visit_concat_in">visit_concat_in</a></li><li><a href="#method.visit_post" title="visit_post">visit_post</a></li><li><a href="#method.visit_pre" title="visit_pre">visit_pre</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In regex_<wbr>syntax::<wbr>hir</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">regex_syntax</a>::<wbr><a href="index.html">hir</a></div><h1>Trait <span class="trait">Visitor</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/regex_syntax/hir/visitor.rs.html#15-49">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Visitor {
type <a href="#associatedtype.Output" class="associatedtype">Output</a>;
type <a href="#associatedtype.Err" class="associatedtype">Err</a>;
// Required method
fn <a href="#tymethod.finish" class="fn">finish</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Output" title="type regex_syntax::hir::Visitor::Output">Output</a>, Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Err" title="type regex_syntax::hir::Visitor::Err">Err</a>&gt;;
// Provided methods
fn <a href="#method.start" class="fn">start</a>(&amp;mut self) { ... }
<span class="item-spacer"></span> fn <a href="#method.visit_pre" class="fn">visit_pre</a>(&amp;mut self, _hir: &amp;<a class="struct" href="struct.Hir.html" title="struct regex_syntax::hir::Hir">Hir</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Err" title="type regex_syntax::hir::Visitor::Err">Err</a>&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.visit_post" class="fn">visit_post</a>(&amp;mut self, _hir: &amp;<a class="struct" href="struct.Hir.html" title="struct regex_syntax::hir::Hir">Hir</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Err" title="type regex_syntax::hir::Visitor::Err">Err</a>&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.visit_alternation_in" class="fn">visit_alternation_in</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Err" title="type regex_syntax::hir::Visitor::Err">Err</a>&gt; { ... }
<span class="item-spacer"></span> fn <a href="#method.visit_concat_in" class="fn">visit_concat_in</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Err" title="type regex_syntax::hir::Visitor::Err">Err</a>&gt; { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>A trait for visiting the high-level IR (HIR) in depth first order.</p>
<p>The principle aim of this trait is to enable callers to perform case
analysis on a high-level intermediate representation of a regular
expression without necessarily using recursion. In particular, this permits
callers to do case analysis with constant stack usage, which can be
important since the size of an HIR may be proportional to end user input.</p>
<p>Typical usage of this trait involves providing an implementation and then
running it using the <a href="fn.visit.html" title="fn regex_syntax::hir::visit"><code>visit</code></a> function.</p>
</div></details><h2 id="required-associated-types" class="section-header">Required Associated Types<a href="#required-associated-types" class="anchor">§</a></h2><div class="methods"><details class="toggle" open><summary><section id="associatedtype.Output" class="method"><a class="src rightside" href="../../src/regex_syntax/hir/visitor.rs.html#17">Source</a><h4 class="code-header">type <a href="#associatedtype.Output" class="associatedtype">Output</a></h4></section></summary><div class="docblock"><p>The result of visiting an HIR.</p>
</div></details><details class="toggle" open><summary><section id="associatedtype.Err" class="method"><a class="src rightside" href="../../src/regex_syntax/hir/visitor.rs.html#19">Source</a><h4 class="code-header">type <a href="#associatedtype.Err" class="associatedtype">Err</a></h4></section></summary><div class="docblock"><p>An error that visiting an HIR might return.</p>
</div></details></div><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.finish" class="method"><a class="src rightside" href="../../src/regex_syntax/hir/visitor.rs.html#23">Source</a><h4 class="code-header">fn <a href="#tymethod.finish" class="fn">finish</a>(self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Output" title="type regex_syntax::hir::Visitor::Output">Output</a>, Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Err" title="type regex_syntax::hir::Visitor::Err">Err</a>&gt;</h4></section></summary><div class="docblock"><p>All implementors of <code>Visitor</code> must provide a <code>finish</code> method, which
yields the result of visiting the HIR or an error.</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.start" class="method"><a class="src rightside" href="../../src/regex_syntax/hir/visitor.rs.html#26">Source</a><h4 class="code-header">fn <a href="#method.start" class="fn">start</a>(&amp;mut self)</h4></section></summary><div class="docblock"><p>This method is called before beginning traversal of the HIR.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.visit_pre" class="method"><a class="src rightside" href="../../src/regex_syntax/hir/visitor.rs.html#30-32">Source</a><h4 class="code-header">fn <a href="#method.visit_pre" class="fn">visit_pre</a>(&amp;mut self, _hir: &amp;<a class="struct" href="struct.Hir.html" title="struct regex_syntax::hir::Hir">Hir</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Err" title="type regex_syntax::hir::Visitor::Err">Err</a>&gt;</h4></section></summary><div class="docblock"><p>This method is called on an <code>Hir</code> before descending into child <code>Hir</code>
nodes.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.visit_post" class="method"><a class="src rightside" href="../../src/regex_syntax/hir/visitor.rs.html#36-38">Source</a><h4 class="code-header">fn <a href="#method.visit_post" class="fn">visit_post</a>(&amp;mut self, _hir: &amp;<a class="struct" href="struct.Hir.html" title="struct regex_syntax::hir::Hir">Hir</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Err" title="type regex_syntax::hir::Visitor::Err">Err</a>&gt;</h4></section></summary><div class="docblock"><p>This method is called on an <code>Hir</code> after descending all of its child
<code>Hir</code> nodes.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.visit_alternation_in" class="method"><a class="src rightside" href="../../src/regex_syntax/hir/visitor.rs.html#41-43">Source</a><h4 class="code-header">fn <a href="#method.visit_alternation_in" class="fn">visit_alternation_in</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Err" title="type regex_syntax::hir::Visitor::Err">Err</a>&gt;</h4></section></summary><div class="docblock"><p>This method is called between child nodes of an alternation.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="method.visit_concat_in" class="method"><a class="src rightside" href="../../src/regex_syntax/hir/visitor.rs.html#46-48">Source</a><h4 class="code-header">fn <a href="#method.visit_concat_in" class="fn">visit_concat_in</a>(&amp;mut self) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.93.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/1.93.1/std/primitive.unit.html">()</a>, Self::<a class="associatedtype" href="trait.Visitor.html#associatedtype.Err" title="type regex_syntax::hir::Visitor::Err">Err</a>&gt;</h4></section></summary><div class="docblock"><p>This method is called between child nodes of a concatenation.</p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"></div><script src="../../trait.impl/regex_syntax/hir/visitor/trait.Visitor.js" async></script></section></div></main></body></html>