rust-analyzer/hir_def/trait.HasModule.html
github-merge-queue[bot] cddc2a952f deploy: 9923b0085c
2025-01-11 06:35:13 +00:00

11 lines
No EOL
13 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="API documentation for the Rust `HasModule` trait in crate `hir_def`."><title>HasModule in hir_def - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.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-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="hir_def" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0 (9fc6b4312 2025-01-07)" data-channel="1.84.0" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="sidebar-items.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.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_def/index.html">hir_def</a><span class="version">0.0.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">HasModule</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.module" title="module">module</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.krate" title="krate">krate</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="index.html">In crate hir_<wbr>def</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="index.html">hir_def</a></span><h1>Trait <span class="trait">HasModule</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/hir_def/lib.rs.html#1154-1163">Source</a> </span></div><pre class="rust item-decl"><code>pub trait HasModule {
// Required method
fn <a href="#tymethod.module" class="fn">module</a>(&amp;self, db: &amp;dyn <a class="trait" href="db/trait.DefDatabase.html" title="trait hir_def::db::DefDatabase">DefDatabase</a>) -&gt; <a class="struct" href="struct.ModuleId.html" title="struct hir_def::ModuleId">ModuleId</a>;
// Provided method
fn <a href="#method.krate" class="fn">krate</a>(&amp;self, db: &amp;dyn <a class="trait" href="db/trait.DefDatabase.html" title="trait hir_def::db::DefDatabase">DefDatabase</a>) -&gt; CrateId { ... }
}</code></pre><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.module" class="method"><a class="src rightside" href="../src/hir_def/lib.rs.html#1156">Source</a><h4 class="code-header">fn <a href="#tymethod.module" class="fn">module</a>(&amp;self, db: &amp;dyn <a class="trait" href="db/trait.DefDatabase.html" title="trait hir_def::db::DefDatabase">DefDatabase</a>) -&gt; <a class="struct" href="struct.ModuleId.html" title="struct hir_def::ModuleId">ModuleId</a></h4></section></summary><div class="docblock"><p>Returns the enclosing module this thing is defined within.</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.krate" class="method"><a class="src rightside" href="../src/hir_def/lib.rs.html#1160-1162">Source</a><h4 class="code-header">fn <a href="#method.krate" class="fn">krate</a>(&amp;self, db: &amp;dyn <a class="trait" href="db/trait.DefDatabase.html" title="trait hir_def::db::DefDatabase">DefDatabase</a>) -&gt; CrateId</h4></section></summary><div class="docblock"><p>Returns the crate this thing is defined within.</p>
</div></details></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><section id="impl-HasModule-for-AdtId" class="impl"><a class="src rightside" href="../src/hir_def/lib.rs.html#1280-1288">Source</a><a href="#impl-HasModule-for-AdtId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.HasModule.html" title="trait hir_def::HasModule">HasModule</a> for <a class="enum" href="enum.AdtId.html" title="enum hir_def::AdtId">AdtId</a></h3></section><section id="impl-HasModule-for-AttrDefId" class="impl"><a class="src rightside" href="../src/hir_def/lib.rs.html#1353-1379">Source</a><a href="#impl-HasModule-for-AttrDefId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.HasModule.html" title="trait hir_def::HasModule">HasModule</a> for <a class="enum" href="enum.AttrDefId.html" title="enum hir_def::AttrDefId">AttrDefId</a></h3></section><section id="impl-HasModule-for-DefWithBodyId" class="impl"><a class="src rightside" href="../src/hir_def/lib.rs.html#1327-1337">Source</a><a href="#impl-HasModule-for-DefWithBodyId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.HasModule.html" title="trait hir_def::HasModule">HasModule</a> for <a class="enum" href="enum.DefWithBodyId.html" title="enum hir_def::DefWithBodyId">DefWithBodyId</a></h3></section><section id="impl-HasModule-for-GenericDefId" class="impl"><a class="src rightside" href="../src/hir_def/lib.rs.html#1339-1351">Source</a><a href="#impl-HasModule-for-GenericDefId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.HasModule.html" title="trait hir_def::HasModule">HasModule</a> for <a class="enum" href="enum.GenericDefId.html" title="enum hir_def::GenericDefId">GenericDefId</a></h3></section><section id="impl-HasModule-for-ItemContainerId" class="impl"><a class="src rightside" href="../src/hir_def/lib.rs.html#1269-1278">Source</a><a href="#impl-HasModule-for-ItemContainerId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.HasModule.html" title="trait hir_def::HasModule">HasModule</a> for <a class="enum" href="enum.ItemContainerId.html" title="enum hir_def::ItemContainerId">ItemContainerId</a></h3></section><section id="impl-HasModule-for-MacroId" class="impl"><a class="src rightside" href="../src/hir_def/lib.rs.html#1300-1308">Source</a><a href="#impl-HasModule-for-MacroId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.HasModule.html" title="trait hir_def::HasModule">HasModule</a> for <a class="enum" href="enum.MacroId.html" title="enum hir_def::MacroId">MacroId</a></h3></section><section id="impl-HasModule-for-TypeOwnerId" class="impl"><a class="src rightside" href="../src/hir_def/lib.rs.html#1310-1325">Source</a><a href="#impl-HasModule-for-TypeOwnerId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.HasModule.html" title="trait hir_def::HasModule">HasModule</a> for <a class="enum" href="enum.TypeOwnerId.html" title="enum hir_def::TypeOwnerId">TypeOwnerId</a></h3></section><section id="impl-HasModule-for-VariantId" class="impl"><a class="src rightside" href="../src/hir_def/lib.rs.html#1290-1298">Source</a><a href="#impl-HasModule-for-VariantId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.HasModule.html" title="trait hir_def::HasModule">HasModule</a> for <a class="enum" href="enum.VariantId.html" title="enum hir_def::VariantId">VariantId</a></h3></section><section id="impl-HasModule-for-ConstId" class="impl"><a class="src rightside" href="../src/hir_def/lib.rs.html#1219-1224">Source</a><a href="#impl-HasModule-for-ConstId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.HasModule.html" title="trait hir_def::HasModule">HasModule</a> for <a class="struct" href="struct.ConstId.html" title="struct hir_def::ConstId">ConstId</a></h3></section><section id="impl-HasModule-for-EnumVariantId" class="impl"><a class="src rightside" href="../src/hir_def/lib.rs.html#1241-1246">Source</a><a href="#impl-HasModule-for-EnumVariantId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.HasModule.html" title="trait hir_def::HasModule">HasModule</a> for <a class="struct" href="struct.EnumVariantId.html" title="struct hir_def::EnumVariantId">EnumVariantId</a></h3></section><section id="impl-HasModule-for-FunctionId" class="impl"><a class="src rightside" href="../src/hir_def/lib.rs.html#1212-1217">Source</a><a href="#impl-HasModule-for-FunctionId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.HasModule.html" title="trait hir_def::HasModule">HasModule</a> for <a class="struct" href="struct.FunctionId.html" title="struct hir_def::FunctionId">FunctionId</a></h3></section><section id="impl-HasModule-for-Macro2Id" class="impl"><a class="src rightside" href="../src/hir_def/lib.rs.html#1255-1260">Source</a><a href="#impl-HasModule-for-Macro2Id" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.HasModule.html" title="trait hir_def::HasModule">HasModule</a> for <a class="struct" href="struct.Macro2Id.html" title="struct hir_def::Macro2Id">Macro2Id</a></h3></section><section id="impl-HasModule-for-MacroRulesId" class="impl"><a class="src rightside" href="../src/hir_def/lib.rs.html#1248-1253">Source</a><a href="#impl-HasModule-for-MacroRulesId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.HasModule.html" title="trait hir_def::HasModule">HasModule</a> for <a class="struct" href="struct.MacroRulesId.html" title="struct hir_def::MacroRulesId">MacroRulesId</a></h3></section><section id="impl-HasModule-for-ProcMacroId" class="impl"><a class="src rightside" href="../src/hir_def/lib.rs.html#1262-1267">Source</a><a href="#impl-HasModule-for-ProcMacroId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.HasModule.html" title="trait hir_def::HasModule">HasModule</a> for <a class="struct" href="struct.ProcMacroId.html" title="struct hir_def::ProcMacroId">ProcMacroId</a></h3></section><section id="impl-HasModule-for-StaticId" class="impl"><a class="src rightside" href="../src/hir_def/lib.rs.html#1226-1231">Source</a><a href="#impl-HasModule-for-StaticId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.HasModule.html" title="trait hir_def::HasModule">HasModule</a> for <a class="struct" href="struct.StaticId.html" title="struct hir_def::StaticId">StaticId</a></h3></section><section id="impl-HasModule-for-TypeAliasId" class="impl"><a class="src rightside" href="../src/hir_def/lib.rs.html#1233-1238">Source</a><a href="#impl-HasModule-for-TypeAliasId" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.HasModule.html" title="trait hir_def::HasModule">HasModule</a> for <a class="struct" href="struct.TypeAliasId.html" title="struct hir_def::TypeAliasId">TypeAliasId</a></h3></section><section id="impl-HasModule-for-ItemId" class="impl"><a class="src rightside" href="../src/hir_def/lib.rs.html#1179-1188">Source</a><a href="#impl-HasModule-for-ItemId" class="anchor">§</a><h3 class="code-header">impl&lt;N, ItemId&gt; <a class="trait" href="trait.HasModule.html" title="trait hir_def::HasModule">HasModule</a> for ItemId<div class="where">where
N: <a class="trait" href="item_tree/trait.ItemTreeNode.html" title="trait hir_def::item_tree::ItemTreeNode">ItemTreeNode</a>,
ItemId: for&lt;'db&gt; <a class="trait" href="trait.Lookup.html" title="trait hir_def::Lookup">Lookup</a>&lt;Database&lt;'db&gt; = dyn <a class="trait" href="db/trait.DefDatabase.html" title="trait hir_def::db::DefDatabase">DefDatabase</a> + 'db, Data = <a class="struct" href="struct.ItemLoc.html" title="struct hir_def::ItemLoc">ItemLoc</a>&lt;N&gt;&gt; + <a class="trait" href="https://doc.rust-lang.org/1.84.0/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a>,</div></h3></section></div><script src="../trait.impl/hir_def/trait.HasModule.js" async></script></section></div></main></body></html>