You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Trac3r-rust/doc/syn/visit/index.html

30 lines
22 KiB

5 years ago
<!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="API documentation for the Rust `visit` mod in crate `syn`."><meta name="keywords" content="rust, rustlang, rust-lang, visit"><title>syn::visit - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="shortcut icon" href="../../favicon.ico"><style type="text/css">#crate-search{background-image:url("../../down-arrow.svg");}</style></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">&#9776;</div><a href='../../syn/index.html'><div class='logo-container'><img src='../../rust-logo.png' alt='logo'></div></a><p class='location'>Module visit</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#traits">Traits</a></li><li><a href="#functions">Functions</a></li></ul></div><p class='location'><a href='../index.html'>syn</a></p><script>window.sidebarCurrent = {name: 'visit', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>&#x2212;</span>]</a></span><a class='srclink' href='../../src/syn/gen/visit.rs.html#4-3372' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>syn</a>::<wbr><a class="mod" href=''>visit</a></span></h1><div class='docblock'><p>Syntax tree traversal to walk a shared borrow of a syntax tree.</p>
<p>Each method of the <a href="trait.Visit.html"><code>Visit</code></a> trait is a hook that can be overridden to
customize the behavior when visiting the corresponding type of node. By
default, every method recursively visits the substructure of the input
by invoking the right visitor method of each of its fields.</p>
<pre><code class="language-edition2018"># use syn::{Attribute, BinOp, Expr, ExprBinary};
#
pub trait Visit&lt;'ast&gt; {
/* ... */
fn visit_expr_binary(&amp;mut self, node: &amp;'ast ExprBinary) {
for attr in &amp;node.attrs {
self.visit_attribute(attr);
}
self.visit_expr(&amp;*node.left);
self.visit_bin_op(&amp;node.op);
self.visit_expr(&amp;*node.right);
}
/* ... */
# fn visit_attribute(&amp;mut self, node: &amp;'ast Attribute);
# fn visit_expr(&amp;mut self, node: &amp;'ast Expr);
# fn visit_bin_op(&amp;mut self, node: &amp;'ast BinOp);
}
</code></pre>
<p><em>This module is available if Syn is built with the <code>&quot;visit&quot;</code> feature.</em></p>
</div><h2 id='traits' class='section-header'><a href="#traits">Traits</a></h2>
<table><tr class='module-item'><td><a class="trait" href="trait.Visit.html" title='syn::visit::Visit trait'>Visit</a></td><td class='docblock-short'><p>Syntax tree traversal to walk a shared borrow of a syntax tree.</p>
</td></tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
<table><tr class='module-item'><td><a class="fn" href="fn.visit_abi.html" title='syn::visit::visit_abi fn'>visit_abi</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_angle_bracketed_generic_arguments.html" title='syn::visit::visit_angle_bracketed_generic_arguments fn'>visit_angle_bracketed_generic_arguments</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_attr_style.html" title='syn::visit::visit_attr_style fn'>visit_attr_style</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_attribute.html" title='syn::visit::visit_attribute fn'>visit_attribute</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_bare_fn_arg.html" title='syn::visit::visit_bare_fn_arg fn'>visit_bare_fn_arg</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_bare_fn_arg_name.html" title='syn::visit::visit_bare_fn_arg_name fn'>visit_bare_fn_arg_name</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_bin_op.html" title='syn::visit::visit_bin_op fn'>visit_bin_op</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_binding.html" title='syn::visit::visit_binding fn'>visit_binding</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_bound_lifetimes.html" title='syn::visit::visit_bound_lifetimes fn'>visit_bound_lifetimes</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_const_param.html" title='syn::visit::visit_const_param fn'>visit_const_param</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_constraint.html" title='syn::visit::visit_constraint fn'>visit_constraint</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_data.html" title='syn::visit::visit_data fn'>visit_data</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_data_enum.html" title='syn::visit::visit_data_enum fn'>visit_data_enum</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_data_struct.html" title='syn::visit::visit_data_struct fn'>visit_data_struct</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_data_union.html" title='syn::visit::visit_data_union fn'>visit_data_union</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_derive_input.html" title='syn::visit::visit_derive_input fn'>visit_derive_input</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_expr.html" title='syn::visit::visit_expr fn'>visit_expr</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_expr_binary.html" title='syn::visit::visit_expr_binary fn'>visit_expr_binary</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_expr_call.html" title='syn::visit::visit_expr_call fn'>visit_expr_call</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_expr_cast.html" title='syn::visit::visit_expr_cast fn'>visit_expr_cast</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_expr_field.html" title='syn::visit::visit_expr_field fn'>visit_expr_field</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_expr_index.html" title='syn::visit::visit_expr_index fn'>visit_expr_index</a></td><td class='docblock-short'></td></tr><tr class='module-item'><td><a class="fn" href="fn.visit_expr_lit.html" title='syn::visit::visit_expr_lit fn'>visit_expr_lit</a></td><td class='docblock-short'></td></tr><tr class='modul