blob: ef3739623a689ba414760d02c7544a007867a2eb [file] [log] [blame] [edit]
<!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="`tt` crate defines a `TokenTree` data structure: this is the interface (both input and output) of macros."><title>tt - 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" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-84e720fa.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="tt" data-themes="" data-resource-suffix="" data-rustdoc-version="1.89.0 (29483883e 2025-08-04)" data-channel="1.89.0" data-search-js="search-92309212.js" data-settings-js="settings-5514c975.js" ><script src="../static.files/storage-4e99c027.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-fd3af306.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-32bb7600.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 mod crate"><!--[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="../tt/index.html">tt</a><span class="version">0.0.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="#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="#enums" title="Enums">Enums</a></li><li><a href="#constants" title="Constants">Constants</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"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>tt</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/tt/lib.rs.html#1-1038">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><code>tt</code> crate defines a <code>TokenTree</code> data structure: this is the interface (both
input and output) of macros.</p>
<p>The <code>TokenTree</code> is semantically a tree, but for performance reasons it is stored as a flat structure.</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="buffer/index.html" title="mod tt::buffer">buffer</a></dt><dd>Stateful iteration over token trees.</dd><dt><a class="mod" href="iter/index.html" title="mod tt::iter">iter</a></dt><dd>A “Parser” structure for token trees. We use this when parsing a declarative
macro definition into a list of patterns and templates.</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.DelimSpan.html" title="struct tt::DelimSpan">Delim<wbr>Span</a></dt><dt><a class="struct" href="struct.Delimiter.html" title="struct tt::Delimiter">Delimiter</a></dt><dt><a class="struct" href="struct.Ident.html" title="struct tt::Ident">Ident</a></dt><dd>Identifier or keyword.</dd><dt><a class="struct" href="struct.Lit.html" title="struct tt::Lit">Lit</a></dt><dt><a class="struct" href="struct.Literal.html" title="struct tt::Literal">Literal</a></dt><dt><a class="struct" href="struct.Punct.html" title="struct tt::Punct">Punct</a></dt><dt><a class="struct" href="struct.Subtree.html" title="struct tt::Subtree">Subtree</a></dt><dt><a class="struct" href="struct.SubtreeBuilderRestorePoint.html" title="struct tt::SubtreeBuilderRestorePoint">Subtree<wbr>Builder<wbr>Restore<wbr>Point</a></dt><dt><a class="struct" href="struct.SubtreeView.html" title="struct tt::SubtreeView">Subtree<wbr>View</a></dt><dt><a class="struct" href="struct.TextRange.html" title="struct tt::TextRange">Text<wbr>Range</a></dt><dd>A range in text, represented as a pair of <a href="struct.TextSize.html" title="struct tt::TextSize"><code>TextSize</code></a>.</dd><dt><a class="struct" href="struct.TextSize.html" title="struct tt::TextSize">Text<wbr>Size</a></dt><dd>A measure of text length. Also, equivalently, an index into text.</dd><dt><a class="struct" href="struct.TokenTreesView.html" title="struct tt::TokenTreesView">Token<wbr>Trees<wbr>View</a></dt><dt><a class="struct" href="struct.TopSubtree.html" title="struct tt::TopSubtree">TopSubtree</a></dt><dt><a class="struct" href="struct.TopSubtreeBuilder.html" title="struct tt::TopSubtreeBuilder">TopSubtree<wbr>Builder</a></dt></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.DelimiterKind.html" title="enum tt::DelimiterKind">Delimiter<wbr>Kind</a></dt><dt><a class="enum" href="enum.IdentIsRaw.html" title="enum tt::IdentIsRaw">Ident<wbr>IsRaw</a></dt><dt><a class="enum" href="enum.Leaf.html" title="enum tt::Leaf">Leaf</a></dt><dt><a class="enum" href="enum.LitKind.html" title="enum tt::LitKind">LitKind</a></dt><dt><a class="enum" href="enum.Spacing.html" title="enum tt::Spacing">Spacing</a></dt><dd>Indicates whether a token can join with the following token to form a
compound token. Used for conversions to <code>proc_macro::Spacing</code>. Also used to
guide pretty-printing, which is where the <code>JointHidden</code> value (which isn’t
part of <code>proc_macro::Spacing</code>) comes in useful.</dd><dt><a class="enum" href="enum.TokenTree.html" title="enum tt::TokenTree">Token<wbr>Tree</a></dt></dl><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><dl class="item-table"><dt><a class="constant" href="constant.MAX_GLUED_PUNCT_LEN.html" title="constant tt::MAX_GLUED_PUNCT_LEN">MAX_<wbr>GLUED_<wbr>PUNCT_<wbr>LEN</a></dt></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.pretty.html" title="fn tt::pretty">pretty</a></dt><dt><a class="fn" href="fn.token_to_literal.html" title="fn tt::token_to_literal">token_<wbr>to_<wbr>literal</a></dt></dl></section></div></main></body></html>