blob: c7baee45613a135e2f9188ebcaa952e5c9d42236 [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="API documentation for the Rust `ExpandDatabase` trait in crate `hir`."><title>ExpandDatabase in hir::db - 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="hir" 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="sidebar-items.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 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="../../hir/index.html">hir</a><span class="version">0.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Expand<wbr>Database</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.ast_id_map" title="ast_id_map">ast_id_map</a></li><li><a href="#tymethod.decl_macro_expander" title="decl_macro_expander">decl_macro_expander</a></li><li><a href="#tymethod.expand_proc_macro" title="expand_proc_macro">expand_proc_macro</a></li><li><a href="#tymethod.expansion_span_map" title="expansion_span_map">expansion_span_map</a></li><li><a href="#tymethod.intern_macro_call" title="intern_macro_call">intern_macro_call</a></li><li><a href="#tymethod.lookup_intern_macro_call" title="lookup_intern_macro_call">lookup_intern_macro_call</a></li><li><a href="#tymethod.macro_arg" title="macro_arg">macro_arg</a></li><li><a href="#tymethod.macro_arg_considering_derives" title="macro_arg_considering_derives">macro_arg_considering_derives</a></li><li><a href="#tymethod.macro_expander" title="macro_expander">macro_expander</a></li><li><a href="#tymethod.parse_macro_expansion" title="parse_macro_expansion">parse_macro_expansion</a></li><li><a href="#tymethod.parse_macro_expansion_error" title="parse_macro_expansion_error">parse_macro_expansion_error</a></li><li><a href="#tymethod.parse_or_expand" title="parse_or_expand">parse_or_expand</a></li><li><a href="#tymethod.proc_macro_span" title="proc_macro_span">proc_macro_span</a></li><li><a href="#tymethod.proc_macros" title="proc_macros">proc_macros</a></li><li><a href="#tymethod.proc_macros_for_crate" title="proc_macros_for_crate">proc_macros_for_crate</a></li><li><a href="#tymethod.real_span_map" title="real_span_map">real_span_map</a></li><li><a href="#tymethod.set_proc_macros" title="set_proc_macros">set_proc_macros</a></li><li><a href="#tymethod.set_proc_macros_with_durability" title="set_proc_macros_with_durability">set_proc_macros_with_durability</a></li><li><a href="#tymethod.span_map" title="span_map">span_map</a></li><li><a href="#tymethod.syntax_context" title="syntax_context">syntax_context</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In hir::db</a></h2></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"><div class="rustdoc-breadcrumbs"><a href="../index.html">hir</a>::<wbr><a href="index.html">db</a></div><h1>Trait <span class="trait">ExpandDatabase</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"></span></div><pre class="rust item-decl"><code>pub trait ExpandDatabase: RootQueryDb {
<details class="toggle type-contents-toggle"><summary class="hideme"><span>Show 20 methods</span></summary> // Required methods
fn <a href="#tymethod.proc_macros" class="fn">proc_macros</a>(&amp;self) -&gt; Arc&lt;<a class="struct" href="../struct.ProcMacros.html" title="struct hir::ProcMacros">ProcMacros</a>&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.proc_macros_for_crate" class="fn">proc_macros_for_crate</a>(
&amp;self,
krate: Crate,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.89.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Arc&lt;CrateProcMacros&gt;&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.ast_id_map" class="fn">ast_id_map</a>(&amp;self, file_id: <a class="enum" href="../enum.HirFileId.html" title="enum hir::HirFileId">HirFileId</a>) -&gt; Arc&lt;AstIdMap&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.parse_or_expand" class="fn">parse_or_expand</a>(&amp;self, file_id: <a class="enum" href="../enum.HirFileId.html" title="enum hir::HirFileId">HirFileId</a>) -&gt; SyntaxNode&lt;RustLanguage&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.parse_macro_expansion" class="fn">parse_macro_expansion</a>(
&amp;self,
macro_file: <a class="struct" href="../struct.MacroCallId.html" title="struct hir::MacroCallId">MacroCallId</a>,
) -&gt; ValueResult&lt;(Parse&lt;SyntaxNode&lt;RustLanguage&gt;&gt;, Arc&lt;SpanMap&lt;SyntaxContext&gt;&gt;), ExpandError&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.span_map" class="fn">span_map</a>(&amp;self, file_id: <a class="enum" href="../enum.HirFileId.html" title="enum hir::HirFileId">HirFileId</a>) -&gt; SpanMap;
<span class="item-spacer"></span> fn <a href="#tymethod.expansion_span_map" class="fn">expansion_span_map</a>(
&amp;self,
file_id: <a class="struct" href="../struct.MacroCallId.html" title="struct hir::MacroCallId">MacroCallId</a>,
) -&gt; Arc&lt;SpanMap&lt;SyntaxContext&gt;&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.real_span_map" class="fn">real_span_map</a>(&amp;self, file_id: <a class="struct" href="../struct.EditionedFileId.html" title="struct hir::EditionedFileId">EditionedFileId</a>) -&gt; Arc&lt;RealSpanMap&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.intern_macro_call" class="fn">intern_macro_call</a>(&amp;self, macro_call: MacroCallLoc) -&gt; <a class="struct" href="../struct.MacroCallId.html" title="struct hir::MacroCallId">MacroCallId</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.lookup_intern_macro_call" class="fn">lookup_intern_macro_call</a>(&amp;self, macro_call: <a class="struct" href="../struct.MacroCallId.html" title="struct hir::MacroCallId">MacroCallId</a>) -&gt; MacroCallLoc;
<span class="item-spacer"></span> fn <a href="#tymethod.macro_arg" class="fn">macro_arg</a>(
&amp;self,
id: <a class="struct" href="../struct.MacroCallId.html" title="struct hir::MacroCallId">MacroCallId</a>,
) -&gt; (Arc&lt;TopSubtree&lt;SpanData&lt;SyntaxContext&gt;&gt;&gt;, SyntaxFixupUndoInfo, SpanData&lt;SyntaxContext&gt;);
<span class="item-spacer"></span> fn <a href="#tymethod.macro_arg_considering_derives" class="fn">macro_arg_considering_derives</a>(
&amp;self,
id: <a class="struct" href="../struct.MacroCallId.html" title="struct hir::MacroCallId">MacroCallId</a>,
kind: &amp;MacroCallKind,
) -&gt; (Arc&lt;TopSubtree&lt;SpanData&lt;SyntaxContext&gt;&gt;&gt;, SyntaxFixupUndoInfo, SpanData&lt;SyntaxContext&gt;);
<span class="item-spacer"></span> fn <a href="#tymethod.macro_expander" class="fn">macro_expander</a>(&amp;self, id: MacroDefId) -&gt; TokenExpander;
<span class="item-spacer"></span> fn <a href="#tymethod.decl_macro_expander" class="fn">decl_macro_expander</a>(
&amp;self,
def_crate: Crate,
id: <a class="struct" href="../struct.InFileWrapper.html" title="struct hir::InFileWrapper">InFileWrapper</a>&lt;<a class="enum" href="../enum.HirFileId.html" title="enum hir::HirFileId">HirFileId</a>, FileAstId&lt;Macro&gt;&gt;,
) -&gt; Arc&lt;DeclarativeMacroExpander&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.expand_proc_macro" class="fn">expand_proc_macro</a>(
&amp;self,
call: <a class="struct" href="../struct.MacroCallId.html" title="struct hir::MacroCallId">MacroCallId</a>,
) -&gt; ValueResult&lt;Arc&lt;TopSubtree&lt;SpanData&lt;SyntaxContext&gt;&gt;&gt;, ExpandError&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.proc_macro_span" class="fn">proc_macro_span</a>(
&amp;self,
fun: <a class="struct" href="../struct.InFileWrapper.html" title="struct hir::InFileWrapper">InFileWrapper</a>&lt;<a class="enum" href="../enum.HirFileId.html" title="enum hir::HirFileId">HirFileId</a>, FileAstId&lt;Fn&gt;&gt;,
) -&gt; SpanData&lt;SyntaxContext&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.parse_macro_expansion_error" class="fn">parse_macro_expansion_error</a>(
&amp;self,
macro_call: <a class="struct" href="../struct.MacroCallId.html" title="struct hir::MacroCallId">MacroCallId</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.89.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Arc&lt;ValueResult&lt;Arc&lt;[SyntaxError]&gt;, ExpandError&gt;&gt;&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.syntax_context" class="fn">syntax_context</a>(&amp;self, file: <a class="enum" href="../enum.HirFileId.html" title="enum hir::HirFileId">HirFileId</a>, edition: Edition) -&gt; SyntaxContext;
<span class="item-spacer"></span> fn <a href="#tymethod.set_proc_macros" class="fn">set_proc_macros</a>(&amp;mut self, __value: Arc&lt;<a class="struct" href="../struct.ProcMacros.html" title="struct hir::ProcMacros">ProcMacros</a>&gt;);
<span class="item-spacer"></span> fn <a href="#tymethod.set_proc_macros_with_durability" class="fn">set_proc_macros_with_durability</a>(
&amp;mut self,
__value: Arc&lt;<a class="struct" href="../struct.ProcMacros.html" title="struct hir::ProcMacros">ProcMacros</a>&gt;,
durability: Durability,
);
</details>}</code></pre><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><section id="tymethod.proc_macros" class="method"><h4 class="code-header">fn <a href="#tymethod.proc_macros" class="fn">proc_macros</a>(&amp;self) -&gt; Arc&lt;<a class="struct" href="../struct.ProcMacros.html" title="struct hir::ProcMacros">ProcMacros</a>&gt;</h4></section><section id="tymethod.proc_macros_for_crate" class="method"><h4 class="code-header">fn <a href="#tymethod.proc_macros_for_crate" class="fn">proc_macros_for_crate</a>(&amp;self, krate: Crate) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.89.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Arc&lt;CrateProcMacros&gt;&gt;</h4></section><section id="tymethod.ast_id_map" class="method"><h4 class="code-header">fn <a href="#tymethod.ast_id_map" class="fn">ast_id_map</a>(&amp;self, file_id: <a class="enum" href="../enum.HirFileId.html" title="enum hir::HirFileId">HirFileId</a>) -&gt; Arc&lt;AstIdMap&gt;</h4></section><section id="tymethod.parse_or_expand" class="method"><h4 class="code-header">fn <a href="#tymethod.parse_or_expand" class="fn">parse_or_expand</a>(&amp;self, file_id: <a class="enum" href="../enum.HirFileId.html" title="enum hir::HirFileId">HirFileId</a>) -&gt; SyntaxNode&lt;RustLanguage&gt;</h4></section><section id="tymethod.parse_macro_expansion" class="method"><h4 class="code-header">fn <a href="#tymethod.parse_macro_expansion" class="fn">parse_macro_expansion</a>(
&amp;self,
macro_file: <a class="struct" href="../struct.MacroCallId.html" title="struct hir::MacroCallId">MacroCallId</a>,
) -&gt; ValueResult&lt;(Parse&lt;SyntaxNode&lt;RustLanguage&gt;&gt;, Arc&lt;SpanMap&lt;SyntaxContext&gt;&gt;), ExpandError&gt;</h4></section><section id="tymethod.span_map" class="method"><h4 class="code-header">fn <a href="#tymethod.span_map" class="fn">span_map</a>(&amp;self, file_id: <a class="enum" href="../enum.HirFileId.html" title="enum hir::HirFileId">HirFileId</a>) -&gt; SpanMap</h4></section><section id="tymethod.expansion_span_map" class="method"><h4 class="code-header">fn <a href="#tymethod.expansion_span_map" class="fn">expansion_span_map</a>(
&amp;self,
file_id: <a class="struct" href="../struct.MacroCallId.html" title="struct hir::MacroCallId">MacroCallId</a>,
) -&gt; Arc&lt;SpanMap&lt;SyntaxContext&gt;&gt;</h4></section><section id="tymethod.real_span_map" class="method"><h4 class="code-header">fn <a href="#tymethod.real_span_map" class="fn">real_span_map</a>(&amp;self, file_id: <a class="struct" href="../struct.EditionedFileId.html" title="struct hir::EditionedFileId">EditionedFileId</a>) -&gt; Arc&lt;RealSpanMap&gt;</h4></section><section id="tymethod.intern_macro_call" class="method"><h4 class="code-header">fn <a href="#tymethod.intern_macro_call" class="fn">intern_macro_call</a>(&amp;self, macro_call: MacroCallLoc) -&gt; <a class="struct" href="../struct.MacroCallId.html" title="struct hir::MacroCallId">MacroCallId</a></h4></section><section id="tymethod.lookup_intern_macro_call" class="method"><h4 class="code-header">fn <a href="#tymethod.lookup_intern_macro_call" class="fn">lookup_intern_macro_call</a>(&amp;self, macro_call: <a class="struct" href="../struct.MacroCallId.html" title="struct hir::MacroCallId">MacroCallId</a>) -&gt; MacroCallLoc</h4></section><section id="tymethod.macro_arg" class="method"><h4 class="code-header">fn <a href="#tymethod.macro_arg" class="fn">macro_arg</a>(
&amp;self,
id: <a class="struct" href="../struct.MacroCallId.html" title="struct hir::MacroCallId">MacroCallId</a>,
) -&gt; (Arc&lt;TopSubtree&lt;SpanData&lt;SyntaxContext&gt;&gt;&gt;, SyntaxFixupUndoInfo, SpanData&lt;SyntaxContext&gt;)</h4></section><section id="tymethod.macro_arg_considering_derives" class="method"><h4 class="code-header">fn <a href="#tymethod.macro_arg_considering_derives" class="fn">macro_arg_considering_derives</a>(
&amp;self,
id: <a class="struct" href="../struct.MacroCallId.html" title="struct hir::MacroCallId">MacroCallId</a>,
kind: &amp;MacroCallKind,
) -&gt; (Arc&lt;TopSubtree&lt;SpanData&lt;SyntaxContext&gt;&gt;&gt;, SyntaxFixupUndoInfo, SpanData&lt;SyntaxContext&gt;)</h4></section><section id="tymethod.macro_expander" class="method"><h4 class="code-header">fn <a href="#tymethod.macro_expander" class="fn">macro_expander</a>(&amp;self, id: MacroDefId) -&gt; TokenExpander</h4></section><section id="tymethod.decl_macro_expander" class="method"><h4 class="code-header">fn <a href="#tymethod.decl_macro_expander" class="fn">decl_macro_expander</a>(
&amp;self,
def_crate: Crate,
id: <a class="struct" href="../struct.InFileWrapper.html" title="struct hir::InFileWrapper">InFileWrapper</a>&lt;<a class="enum" href="../enum.HirFileId.html" title="enum hir::HirFileId">HirFileId</a>, FileAstId&lt;Macro&gt;&gt;,
) -&gt; Arc&lt;DeclarativeMacroExpander&gt;</h4></section><section id="tymethod.expand_proc_macro" class="method"><h4 class="code-header">fn <a href="#tymethod.expand_proc_macro" class="fn">expand_proc_macro</a>(
&amp;self,
call: <a class="struct" href="../struct.MacroCallId.html" title="struct hir::MacroCallId">MacroCallId</a>,
) -&gt; ValueResult&lt;Arc&lt;TopSubtree&lt;SpanData&lt;SyntaxContext&gt;&gt;&gt;, ExpandError&gt;</h4></section><section id="tymethod.proc_macro_span" class="method"><h4 class="code-header">fn <a href="#tymethod.proc_macro_span" class="fn">proc_macro_span</a>(
&amp;self,
fun: <a class="struct" href="../struct.InFileWrapper.html" title="struct hir::InFileWrapper">InFileWrapper</a>&lt;<a class="enum" href="../enum.HirFileId.html" title="enum hir::HirFileId">HirFileId</a>, FileAstId&lt;Fn&gt;&gt;,
) -&gt; SpanData&lt;SyntaxContext&gt;</h4></section><section id="tymethod.parse_macro_expansion_error" class="method"><h4 class="code-header">fn <a href="#tymethod.parse_macro_expansion_error" class="fn">parse_macro_expansion_error</a>(
&amp;self,
macro_call: <a class="struct" href="../struct.MacroCallId.html" title="struct hir::MacroCallId">MacroCallId</a>,
) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.89.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Arc&lt;ValueResult&lt;Arc&lt;[SyntaxError]&gt;, ExpandError&gt;&gt;&gt;</h4></section><section id="tymethod.syntax_context" class="method"><h4 class="code-header">fn <a href="#tymethod.syntax_context" class="fn">syntax_context</a>(&amp;self, file: <a class="enum" href="../enum.HirFileId.html" title="enum hir::HirFileId">HirFileId</a>, edition: Edition) -&gt; SyntaxContext</h4></section><section id="tymethod.set_proc_macros" class="method"><h4 class="code-header">fn <a href="#tymethod.set_proc_macros" class="fn">set_proc_macros</a>(&amp;mut self, __value: Arc&lt;<a class="struct" href="../struct.ProcMacros.html" title="struct hir::ProcMacros">ProcMacros</a>&gt;)</h4></section><section id="tymethod.set_proc_macros_with_durability" class="method"><h4 class="code-header">fn <a href="#tymethod.set_proc_macros_with_durability" class="fn">set_proc_macros_with_durability</a>(
&amp;mut self,
__value: Arc&lt;<a class="struct" href="../struct.ProcMacros.html" title="struct hir::ProcMacros">ProcMacros</a>&gt;,
durability: Durability,
)</h4></section></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-ExpandDatabase-for-DB" class="impl"><a href="#impl-ExpandDatabase-for-DB" class="anchor">§</a><h3 class="code-header">impl&lt;DB&gt; <a class="trait" href="trait.ExpandDatabase.html" title="trait hir::db::ExpandDatabase">ExpandDatabase</a> for DB<div class="where">where
DB: RootQueryDb,</div></h3></section></div><script src="../../trait.impl/hir_expand/db/trait.ExpandDatabase.js" async></script></section></div></main></body></html>