pnmixer-rust/syn/visit/trait.Visitor.html

150 lines
17 KiB
HTML
Raw Normal View History

2017-07-14 23:30:16 +00:00
<!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 `Visitor` trait in crate `syn`.">
<meta name="keywords" content="rust, rustlang, rust-lang, Visitor">
<title>syn::visit::Visitor - Rust</title>
<link rel="stylesheet" type="text/css" href="../../normalize.css">
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc trait">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'>Trait Visitor</p><div class="block items"><ul><li><a href="#provided-methods">Provided Methods</a></li><li><a href="#implementors">Implementors</a></li></ul></div><p class='location'><a href='../index.html'>syn</a>::<wbr><a href='index.html'>visit</a></p><script>window.sidebarCurrent = {name: 'Visitor', ty: 'trait', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Trait <a href='../index.html'>syn</a>::<wbr><a href='index.html'>visit</a>::<wbr><a class="trait" href=''>Visitor</a></span><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/visit.rs.html#29-132' title='goto source code'>[src]</a></span></h1>
<pre class='rust trait'>pub trait Visitor: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
fn <a href='#method.visit_ident' class='fnname'>visit_ident</a>(&amp;mut self, _ident: &amp;<a class="struct" href="../../syn/struct.Ident.html" title="struct syn::Ident">Ident</a>) { ... }
fn <a href='#method.visit_derive_input' class='fnname'>visit_derive_input</a>(&amp;mut self, derive_input: &amp;<a class="struct" href="../../syn/struct.DeriveInput.html" title="struct syn::DeriveInput">DeriveInput</a>) { ... }
fn <a href='#method.visit_ty' class='fnname'>visit_ty</a>(&amp;mut self, ty: &amp;<a class="enum" href="../../syn/enum.Ty.html" title="enum syn::Ty">Ty</a>) { ... }
fn <a href='#method.visit_generics' class='fnname'>visit_generics</a>(&amp;mut self, generics: &amp;<a class="struct" href="../../syn/struct.Generics.html" title="struct syn::Generics">Generics</a>) { ... }
fn <a href='#method.visit_ty_param_bound' class='fnname'>visit_ty_param_bound</a>(&amp;mut self, bound: &amp;<a class="enum" href="../../syn/enum.TyParamBound.html" title="enum syn::TyParamBound">TyParamBound</a>) { ... }
fn <a href='#method.visit_poly_trait_ref' class='fnname'>visit_poly_trait_ref</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;trait_ref: &amp;<a class="struct" href="../../syn/struct.PolyTraitRef.html" title="struct syn::PolyTraitRef">PolyTraitRef</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modifier: &amp;<a class="enum" href="../../syn/enum.TraitBoundModifier.html" title="enum syn::TraitBoundModifier">TraitBoundModifier</a><br>&nbsp;&nbsp;&nbsp;&nbsp;) { ... }
fn <a href='#method.visit_variant_data' class='fnname'>visit_variant_data</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data: &amp;<a class="enum" href="../../syn/enum.VariantData.html" title="enum syn::VariantData">VariantData</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_ident: &amp;<a class="struct" href="../../syn/struct.Ident.html" title="struct syn::Ident">Ident</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_generics: &amp;<a class="struct" href="../../syn/struct.Generics.html" title="struct syn::Generics">Generics</a><br>&nbsp;&nbsp;&nbsp;&nbsp;) { ... }
fn <a href='#method.visit_field' class='fnname'>visit_field</a>(&amp;mut self, field: &amp;<a class="struct" href="../../syn/struct.Field.html" title="struct syn::Field">Field</a>) { ... }
fn <a href='#method.visit_variant' class='fnname'>visit_variant</a>(&amp;mut self, variant: &amp;<a class="struct" href="../../syn/struct.Variant.html" title="struct syn::Variant">Variant</a>, generics: &amp;<a class="struct" href="../../syn/struct.Generics.html" title="struct syn::Generics">Generics</a>) { ... }
fn <a href='#method.visit_lifetime' class='fnname'>visit_lifetime</a>(&amp;mut self, _lifetime: &amp;<a class="struct" href="../../syn/struct.Lifetime.html" title="struct syn::Lifetime">Lifetime</a>) { ... }
fn <a href='#method.visit_lifetime_def' class='fnname'>visit_lifetime_def</a>(&amp;mut self, lifetime: &amp;<a class="struct" href="../../syn/struct.LifetimeDef.html" title="struct syn::LifetimeDef">LifetimeDef</a>) { ... }
fn <a href='#method.visit_path' class='fnname'>visit_path</a>(&amp;mut self, path: &amp;<a class="struct" href="../../syn/struct.Path.html" title="struct syn::Path">Path</a>) { ... }
fn <a href='#method.visit_path_segment' class='fnname'>visit_path_segment</a>(&amp;mut self, path_segment: &amp;<a class="struct" href="../../syn/struct.PathSegment.html" title="struct syn::PathSegment">PathSegment</a>) { ... }
fn <a href='#method.visit_path_parameters' class='fnname'>visit_path_parameters</a>(&amp;mut self, path_parameters: &amp;<a class="enum" href="../../syn/enum.PathParameters.html" title="enum syn::PathParameters">PathParameters</a>) { ... }
fn <a href='#method.visit_assoc_type_binding' class='fnname'>visit_assoc_type_binding</a>(&amp;mut self, type_binding: &amp;<a class="struct" href="../../syn/struct.TypeBinding.html" title="struct syn::TypeBinding">TypeBinding</a>) { ... }
fn <a href='#method.visit_attribute' class='fnname'>visit_attribute</a>(&amp;mut self, _attr: &amp;<a class="struct" href="../../syn/struct.Attribute.html" title="struct syn::Attribute">Attribute</a>) { ... }
fn <a href='#method.visit_fn_ret_ty' class='fnname'>visit_fn_ret_ty</a>(&amp;mut self, ret_ty: &amp;<a class="enum" href="../../syn/enum.FunctionRetTy.html" title="enum syn::FunctionRetTy">FunctionRetTy</a>) { ... }
fn <a href='#method.visit_const_expr' class='fnname'>visit_const_expr</a>(&amp;mut self, expr: &amp;<a class="enum" href="../../syn/enum.ConstExpr.html" title="enum syn::ConstExpr">ConstExpr</a>) { ... }
fn <a href='#method.visit_lit' class='fnname'>visit_lit</a>(&amp;mut self, _lit: &amp;<a class="enum" href="../../syn/enum.Lit.html" title="enum syn::Lit">Lit</a>) { ... }
fn <a href='#method.visit_mac' class='fnname'>visit_mac</a>(&amp;mut self, mac: &amp;<a class="struct" href="../../syn/struct.Mac.html" title="struct syn::Mac">Mac</a>) { ... }
}</pre><div class='docblock'><p>Each method of the Visitor trait is a hook to be potentially
overridden. Each method&#39;s default implementation recursively visits
the substructure of the input via the corresponding <code>walk</code> method;
e.g. the <code>visit_mod</code> method by default calls <code>visit::walk_mod</code>.</p>
<p>If you want to ensure that your code handles every variant
explicitly, you need to override each method. (And you also need
to monitor future changes to <code>Visitor</code> in case a new method with a
new default implementation gets introduced.)</p>
</div>
<h2 id='provided-methods'>Provided Methods</h2>
<div class='methods'>
<h3 id='method.visit_ident' class='method'><span id='visit_ident.v' class='invisible'><code>fn <a href='#method.visit_ident' class='fnname'>visit_ident</a>(&amp;mut self, _ident: &amp;<a class="struct" href="../../syn/struct.Ident.html" title="struct syn::Ident">Ident</a>)</code></span></h3><h3 id='method.visit_derive_input' class='method'><span id='visit_derive_input.v' class='invisible'><code>fn <a href='#method.visit_derive_input' class='fnname'>visit_derive_input</a>(&amp;mut self, derive_input: &amp;<a class="struct" href="../../syn/struct.DeriveInput.html" title="struct syn::DeriveInput">DeriveInput</a>)</code></span></h3><h3 id='method.visit_ty' class='method'><span id='visit_ty.v' class='invisible'><code>fn <a href='#method.visit_ty' class='fnname'>visit_ty</a>(&amp;mut self, ty: &amp;<a class="enum" href="../../syn/enum.Ty.html" title="enum syn::Ty">Ty</a>)</code></span></h3><h3 id='method.visit_generics' class='method'><span id='visit_generics.v' class='invisible'><code>fn <a href='#method.visit_generics' class='fnname'>visit_generics</a>(&amp;mut self, generics: &amp;<a class="struct" href="../../syn/struct.Generics.html" title="struct syn::Generics">Generics</a>)</code></span></h3><h3 id='method.visit_ty_param_bound' class='method'><span id='visit_ty_param_bound.v' class='invisible'><code>fn <a href='#method.visit_ty_param_bound' class='fnname'>visit_ty_param_bound</a>(&amp;mut self, bound: &amp;<a class="enum" href="../../syn/enum.TyParamBound.html" title="enum syn::TyParamBound">TyParamBound</a>)</code></span></h3><h3 id='method.visit_poly_trait_ref' class='method'><span id='visit_poly_trait_ref.v' class='invisible'><code>fn <a href='#method.visit_poly_trait_ref' class='fnname'>visit_poly_trait_ref</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;trait_ref: &amp;<a class="struct" href="../../syn/struct.PolyTraitRef.html" title="struct syn::PolyTraitRef">PolyTraitRef</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;modifier: &amp;<a class="enum" href="../../syn/enum.TraitBoundModifier.html" title="enum syn::TraitBoundModifier">TraitBoundModifier</a><br>)</code></span></h3><h3 id='method.visit_variant_data' class='method'><span id='visit_variant_data.v' class='invisible'><code>fn <a href='#method.visit_variant_data' class='fnname'>visit_variant_data</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;data: &amp;<a class="enum" href="../../syn/enum.VariantData.html" title="enum syn::VariantData">VariantData</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;_ident: &amp;<a class="struct" href="../../syn/struct.Ident.html" title="struct syn::Ident">Ident</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;_generics: &amp;<a class="struct" href="../../syn/struct.Generics.html" title="struct syn::Generics">Generics</a><br>)</code></span></h3><h3 id='method.visit_field' class='method'><span id='visit_field.v' class='invisible'><code>fn <a href='#method.visit_field' class='fnname'>visit_field</a>(&amp;mut self, field: &amp;<a class="struct" href="../../syn/struct.Field.html" title="struct syn::Field">Field</a>)</code></span></h3><h3 id='method.visit_variant' class='method'><span id='visit_variant.v' class='invisible'><code>fn <a href='#method.visit_variant' class='fnname'>visit_variant</a>(&amp;mut self, variant: &amp;<a class="struct" href="../../syn/struct.Variant.html" title="struct syn::Variant">Variant</a>, generics: &amp;<a class="struct" href="../../syn/struct.Generics.html" title="struct syn::Generics">Generics</a>)</code></span></h3><h3 id='method.visit_lifetime' class='method'><span id='visit_lifetime.v' class='invisible'><code>fn <a href='#method.visit_lifetime' class='fnname'>visit_lifetime</a>(&amp;mut self, _lifetime: &amp;<a class="struct" href="../../syn/struct.Lifetime.html" title="struct syn::Lifetime">Lifetime</a>)</code></span></h3><h3 id='method.visit_lifetime_def' class='method'><span id='visit_lifetime_def.v' class='invisible'><code>fn <a href='#method.visit_lifetime_def' class='fnname'>visit_lifetime_def</a>(&amp;mut self, lifetime: &amp;<a class="struct" href="../../syn/struct.Lifetime
<h2 id='implementors'>Implementors</h2>
<ul class='item-list' id='implementors-list'>
</ul><script type="text/javascript" async
src="../../implementors/syn/visit/trait.Visitor.js">
</script></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "syn";
</script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>