pub trait DefsGroup: Database {
Show 52 methods
// Provided methods
fn default_macro_plugins_input(&self) -> &[MacroPluginLongId] { ... }
fn macro_plugin_overrides_input(
&self,
) -> &OrderedHashMap<CrateInput, Arc<[MacroPluginLongId]>> { ... }
fn inline_macro_plugin_overrides_input(
&self,
) -> &OrderedHashMap<CrateInput, Arc<OrderedHashMap<String, InlineMacroExprPluginLongId>>> { ... }
fn default_inline_macro_plugins_input(
&self,
) -> &OrderedHashMap<String, InlineMacroExprPluginLongId> { ... }
fn default_macro_plugins<'db>(&'db self) -> &'db [MacroPluginId<'db>] { ... }
fn macro_plugin_overrides<'db>(
&'db self,
) -> &'db OrderedHashMap<CrateId<'db>, Vec<MacroPluginId<'db>>> { ... }
fn crate_macro_plugins<'db>(
&'db self,
crate_id: CrateId<'db>,
) -> &'db [MacroPluginId<'db>] { ... }
fn default_inline_macro_plugins<'db>(
&'db self,
) -> &'db OrderedHashMap<String, InlineMacroExprPluginId<'db>> { ... }
fn inline_macro_plugin_overrides<'db>(
&'db self,
) -> &'db OrderedHashMap<CrateId<'db>, OrderedHashMap<String, InlineMacroExprPluginId<'db>>> { ... }
fn crate_inline_macro_plugins<'db>(
&'db self,
crate_id: CrateId<'db>,
) -> &'db OrderedHashMap<String, InlineMacroExprPluginId<'db>> { ... }
fn allowed_attributes<'db>(
&'db self,
crate_id: CrateId<'db>,
) -> &'db OrderedHashSet<SmolStrId<'db>> { ... }
fn allowed_statement_attributes<'db>(
&'db self,
) -> &'db OrderedHashSet<SmolStrId<'db>> { ... }
fn declared_derives<'db>(
&'db self,
crate_id: CrateId<'db>,
) -> &'db OrderedHashSet<SmolStrId<'db>> { ... }
fn declared_phantom_type_attributes<'db>(
&'db self,
crate_id: CrateId<'db>,
) -> &'db OrderedHashSet<SmolStrId<'db>> { ... }
fn is_submodule_inline<'db>(&self, submodule_id: SubmoduleId<'db>) -> bool { ... }
fn module_main_file<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<FileId<'db>> { ... }
fn module_files<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db [FileId<'db>]> { ... }
fn module_dir<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db Directory<'db>> { ... }
fn crate_modules<'db>(
&'db self,
crate_id: CrateId<'db>,
) -> &'db [ModuleId<'db>] { ... }
fn file_modules<'db>(
&'db self,
file_id: FileId<'db>,
) -> Maybe<&'db Vec<ModuleId<'db>>> { ... }
fn cached_crate_modules<'db>(
&'db self,
crate_id: CrateId<'db>,
) -> Option<ModuleDataCacheAndLoadingData<'db>> { ... }
fn module_submodules_ids<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db [SubmoduleId<'db>]> { ... }
fn module_constants_ids<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db [ConstantId<'db>]> { ... }
fn module_constant_by_id<'db>(
&'db self,
constant_data: ConstantId<'db>,
) -> Maybe<ItemConstant<'db>> { ... }
fn module_free_functions_ids<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db [FreeFunctionId<'db>]> { ... }
fn module_free_function_by_id<'db>(
&'db self,
free_function_id: FreeFunctionId<'db>,
) -> Maybe<FunctionWithBody<'db>> { ... }
fn module_item_name_stable_ptr<'db>(
&'db self,
module_id: ModuleId<'db>,
item_id: ModuleItemId<'db>,
) -> Maybe<SyntaxStablePtrId<'db>> { ... }
fn module_uses_ids<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db [UseId<'db>]> { ... }
fn module_use_by_id<'db>(
&'db self,
use_id: UseId<'db>,
) -> Maybe<UsePathLeaf<'db>> { ... }
fn module_global_use_by_id<'db>(
&'db self,
global_use_id: GlobalUseId<'db>,
) -> Maybe<UsePathStar<'db>> { ... }
fn module_structs_ids<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db [StructId<'db>]> { ... }
fn module_struct_by_id<'db>(
&'db self,
struct_id: StructId<'db>,
) -> Maybe<ItemStruct<'db>> { ... }
fn module_enums_ids<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db [EnumId<'db>]> { ... }
fn module_enum_by_id<'db>(
&'db self,
enum_id: EnumId<'db>,
) -> Maybe<ItemEnum<'db>> { ... }
fn module_type_aliases_ids<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db [ModuleTypeAliasId<'db>]> { ... }
fn module_type_alias_by_id<'db>(
&'db self,
module_type_alias_id: ModuleTypeAliasId<'db>,
) -> Maybe<ItemTypeAlias<'db>> { ... }
fn module_impl_aliases_ids<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db [ImplAliasId<'db>]> { ... }
fn module_impl_alias_by_id<'db>(
&'db self,
impl_alias_id: ImplAliasId<'db>,
) -> Maybe<ItemImplAlias<'db>> { ... }
fn module_traits_ids<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db [TraitId<'db>]> { ... }
fn module_trait_by_id<'db>(
&'db self,
trait_id: TraitId<'db>,
) -> Maybe<ItemTrait<'db>> { ... }
fn module_impls_ids<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db [ImplDefId<'db>]> { ... }
fn module_impl_by_id<'db>(
&'db self,
impl_id: ImplDefId<'db>,
) -> Maybe<ItemImpl<'db>> { ... }
fn module_extern_types_ids<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db [ExternTypeId<'db>]> { ... }
fn module_extern_type_by_id<'db>(
&'db self,
extern_type_id: ExternTypeId<'db>,
) -> Maybe<ItemExternType<'db>> { ... }
fn module_extern_functions_ids<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db [ExternFunctionId<'db>]> { ... }
fn module_extern_function_by_id<'db>(
&'db self,
extern_function_id: ExternFunctionId<'db>,
) -> Maybe<ItemExternFunction<'db>> { ... }
fn module_macro_declarations_ids<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db [MacroDeclarationId<'db>]> { ... }
fn module_macro_declaration_by_id<'db>(
&'db self,
macro_declaration_id: MacroDeclarationId<'db>,
) -> Maybe<ItemMacroDeclaration<'db>> { ... }
fn module_macro_calls_ids<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db [MacroCallId<'db>]> { ... }
fn module_macro_call_by_id<'db>(
&'db self,
macro_call_id: MacroCallId<'db>,
) -> Maybe<ItemInlineMacro<'db>> { ... }
fn module_ancestors<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> &'db OrderedHashSet<ModuleId<'db>> { ... }
fn module_perceived_module<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> ModuleId<'db> { ... }
}Expand description
Salsa database interface.
See super::ids for further details.
Provided Methods§
fn default_macro_plugins_input(&self) -> &[MacroPluginLongId]
fn macro_plugin_overrides_input( &self, ) -> &OrderedHashMap<CrateInput, Arc<[MacroPluginLongId]>>
fn inline_macro_plugin_overrides_input( &self, ) -> &OrderedHashMap<CrateInput, Arc<OrderedHashMap<String, InlineMacroExprPluginLongId>>>
fn default_inline_macro_plugins_input( &self, ) -> &OrderedHashMap<String, InlineMacroExprPluginLongId>
Sourcefn default_macro_plugins<'db>(&'db self) -> &'db [MacroPluginId<'db>]
fn default_macro_plugins<'db>(&'db self) -> &'db [MacroPluginId<'db>]
Interned version of default_macro_plugins_input.
Sourcefn macro_plugin_overrides<'db>(
&'db self,
) -> &'db OrderedHashMap<CrateId<'db>, Vec<MacroPluginId<'db>>>
fn macro_plugin_overrides<'db>( &'db self, ) -> &'db OrderedHashMap<CrateId<'db>, Vec<MacroPluginId<'db>>>
Interned version of macro_plugin_overrides_input.
Sourcefn crate_macro_plugins<'db>(
&'db self,
crate_id: CrateId<'db>,
) -> &'db [MacroPluginId<'db>]
fn crate_macro_plugins<'db>( &'db self, crate_id: CrateId<'db>, ) -> &'db [MacroPluginId<'db>]
Returns MacroPluginIds of the plugins set for the crate with CrateId.
Provides an override if it has been set with
DefsGroupEx::set_override_crate_macro_plugins or the default
(DefsGroup::default_macro_plugins) otherwise.
Sourcefn default_inline_macro_plugins<'db>(
&'db self,
) -> &'db OrderedHashMap<String, InlineMacroExprPluginId<'db>>
fn default_inline_macro_plugins<'db>( &'db self, ) -> &'db OrderedHashMap<String, InlineMacroExprPluginId<'db>>
Interned version of default_inline_macro_plugins_input.
Sourcefn inline_macro_plugin_overrides<'db>(
&'db self,
) -> &'db OrderedHashMap<CrateId<'db>, OrderedHashMap<String, InlineMacroExprPluginId<'db>>>
fn inline_macro_plugin_overrides<'db>( &'db self, ) -> &'db OrderedHashMap<CrateId<'db>, OrderedHashMap<String, InlineMacroExprPluginId<'db>>>
Interned version of inline_macro_plugin_overrides_input.
Sourcefn crate_inline_macro_plugins<'db>(
&'db self,
crate_id: CrateId<'db>,
) -> &'db OrderedHashMap<String, InlineMacroExprPluginId<'db>>
fn crate_inline_macro_plugins<'db>( &'db self, crate_id: CrateId<'db>, ) -> &'db OrderedHashMap<String, InlineMacroExprPluginId<'db>>
Returns InlineMacroExprPluginIds of the plugins set for the crate with CrateId.
Provides an override if it has been set with
DefsGroupEx::set_override_crate_inline_macro_plugins or the default
(DefsGroup::default_inline_macro_plugins) otherwise.
Sourcefn allowed_attributes<'db>(
&'db self,
crate_id: CrateId<'db>,
) -> &'db OrderedHashSet<SmolStrId<'db>>
fn allowed_attributes<'db>( &'db self, crate_id: CrateId<'db>, ) -> &'db OrderedHashSet<SmolStrId<'db>>
Returns the set of attributes allowed anywhere. An attribute on any item that is not in this set will be handled as an unknown attribute.
Sourcefn allowed_statement_attributes<'db>(
&'db self,
) -> &'db OrderedHashSet<SmolStrId<'db>>
fn allowed_statement_attributes<'db>( &'db self, ) -> &'db OrderedHashSet<SmolStrId<'db>>
Returns the set of attributes allowed on statements. An attribute on a statement that is not in this set will be handled as an unknown attribute.
Sourcefn declared_derives<'db>(
&'db self,
crate_id: CrateId<'db>,
) -> &'db OrderedHashSet<SmolStrId<'db>>
fn declared_derives<'db>( &'db self, crate_id: CrateId<'db>, ) -> &'db OrderedHashSet<SmolStrId<'db>>
Returns the set of derive that were declared as by a plugin.
A derive that is not in this set will be handled as an unknown derive.
Sourcefn declared_phantom_type_attributes<'db>(
&'db self,
crate_id: CrateId<'db>,
) -> &'db OrderedHashSet<SmolStrId<'db>>
fn declared_phantom_type_attributes<'db>( &'db self, crate_id: CrateId<'db>, ) -> &'db OrderedHashSet<SmolStrId<'db>>
Returns the set of attributes that were declared as phantom type attributes by a plugin, i.e. a type marked with this attribute is considered a phantom type.
Sourcefn is_submodule_inline<'db>(&self, submodule_id: SubmoduleId<'db>) -> bool
fn is_submodule_inline<'db>(&self, submodule_id: SubmoduleId<'db>) -> bool
Checks whether the submodule is defined as inline.
Sourcefn module_main_file<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<FileId<'db>>
fn module_main_file<'db>( &'db self, module_id: ModuleId<'db>, ) -> Maybe<FileId<'db>>
Gets the main file of the module. A module might have more virtual files generated by plugins.
Sourcefn module_files<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db [FileId<'db>]>
fn module_files<'db>( &'db self, module_id: ModuleId<'db>, ) -> Maybe<&'db [FileId<'db>]>
Gets all the files of a module - main files and generated virtual files.
Sourcefn module_dir<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db Directory<'db>>
fn module_dir<'db>( &'db self, module_id: ModuleId<'db>, ) -> Maybe<&'db Directory<'db>>
Gets the directory of a module.
fn crate_modules<'db>(&'db self, crate_id: CrateId<'db>) -> &'db [ModuleId<'db>]
fn file_modules<'db>( &'db self, file_id: FileId<'db>, ) -> Maybe<&'db Vec<ModuleId<'db>>>
Sourcefn cached_crate_modules<'db>(
&'db self,
crate_id: CrateId<'db>,
) -> Option<ModuleDataCacheAndLoadingData<'db>>
fn cached_crate_modules<'db>( &'db self, crate_id: CrateId<'db>, ) -> Option<ModuleDataCacheAndLoadingData<'db>>
Returns the ModuleData of all modules in the crate’s cache, and the loading data of the DefsGroup in the crate.
fn module_submodules_ids<'db>( &'db self, module_id: ModuleId<'db>, ) -> Maybe<&'db [SubmoduleId<'db>]>
fn module_constants_ids<'db>( &'db self, module_id: ModuleId<'db>, ) -> Maybe<&'db [ConstantId<'db>]>
fn module_constant_by_id<'db>( &'db self, constant_data: ConstantId<'db>, ) -> Maybe<ItemConstant<'db>>
fn module_free_functions_ids<'db>( &'db self, module_id: ModuleId<'db>, ) -> Maybe<&'db [FreeFunctionId<'db>]>
fn module_free_function_by_id<'db>( &'db self, free_function_id: FreeFunctionId<'db>, ) -> Maybe<FunctionWithBody<'db>>
Sourcefn module_item_name_stable_ptr<'db>(
&'db self,
module_id: ModuleId<'db>,
item_id: ModuleItemId<'db>,
) -> Maybe<SyntaxStablePtrId<'db>>
fn module_item_name_stable_ptr<'db>( &'db self, module_id: ModuleId<'db>, item_id: ModuleItemId<'db>, ) -> Maybe<SyntaxStablePtrId<'db>>
Returns the stable ptr of the name of a module item.
fn module_uses_ids<'db>( &'db self, module_id: ModuleId<'db>, ) -> Maybe<&'db [UseId<'db>]>
fn module_use_by_id<'db>( &'db self, use_id: UseId<'db>, ) -> Maybe<UsePathLeaf<'db>>
fn module_global_use_by_id<'db>( &'db self, global_use_id: GlobalUseId<'db>, ) -> Maybe<UsePathStar<'db>>
fn module_structs_ids<'db>( &'db self, module_id: ModuleId<'db>, ) -> Maybe<&'db [StructId<'db>]>
fn module_struct_by_id<'db>( &'db self, struct_id: StructId<'db>, ) -> Maybe<ItemStruct<'db>>
fn module_enums_ids<'db>( &'db self, module_id: ModuleId<'db>, ) -> Maybe<&'db [EnumId<'db>]>
fn module_enum_by_id<'db>( &'db self, enum_id: EnumId<'db>, ) -> Maybe<ItemEnum<'db>>
fn module_type_aliases_ids<'db>( &'db self, module_id: ModuleId<'db>, ) -> Maybe<&'db [ModuleTypeAliasId<'db>]>
fn module_type_alias_by_id<'db>( &'db self, module_type_alias_id: ModuleTypeAliasId<'db>, ) -> Maybe<ItemTypeAlias<'db>>
fn module_impl_aliases_ids<'db>( &'db self, module_id: ModuleId<'db>, ) -> Maybe<&'db [ImplAliasId<'db>]>
fn module_impl_alias_by_id<'db>( &'db self, impl_alias_id: ImplAliasId<'db>, ) -> Maybe<ItemImplAlias<'db>>
fn module_traits_ids<'db>( &'db self, module_id: ModuleId<'db>, ) -> Maybe<&'db [TraitId<'db>]>
fn module_trait_by_id<'db>( &'db self, trait_id: TraitId<'db>, ) -> Maybe<ItemTrait<'db>>
fn module_impls_ids<'db>( &'db self, module_id: ModuleId<'db>, ) -> Maybe<&'db [ImplDefId<'db>]>
fn module_impl_by_id<'db>( &'db self, impl_id: ImplDefId<'db>, ) -> Maybe<ItemImpl<'db>>
fn module_extern_types_ids<'db>( &'db self, module_id: ModuleId<'db>, ) -> Maybe<&'db [ExternTypeId<'db>]>
fn module_extern_type_by_id<'db>( &'db self, extern_type_id: ExternTypeId<'db>, ) -> Maybe<ItemExternType<'db>>
fn module_extern_functions_ids<'db>( &'db self, module_id: ModuleId<'db>, ) -> Maybe<&'db [ExternFunctionId<'db>]>
fn module_extern_function_by_id<'db>( &'db self, extern_function_id: ExternFunctionId<'db>, ) -> Maybe<ItemExternFunction<'db>>
Sourcefn module_macro_declarations_ids<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db [MacroDeclarationId<'db>]>
fn module_macro_declarations_ids<'db>( &'db self, module_id: ModuleId<'db>, ) -> Maybe<&'db [MacroDeclarationId<'db>]>
Returns the IDs of the macro declarations in the module.
Sourcefn module_macro_declaration_by_id<'db>(
&'db self,
macro_declaration_id: MacroDeclarationId<'db>,
) -> Maybe<ItemMacroDeclaration<'db>>
fn module_macro_declaration_by_id<'db>( &'db self, macro_declaration_id: MacroDeclarationId<'db>, ) -> Maybe<ItemMacroDeclaration<'db>>
Returns the macro declaration by its ID.
Sourcefn module_macro_calls_ids<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> Maybe<&'db [MacroCallId<'db>]>
fn module_macro_calls_ids<'db>( &'db self, module_id: ModuleId<'db>, ) -> Maybe<&'db [MacroCallId<'db>]>
Returns the IDs of the macro calls in the module.
Sourcefn module_macro_call_by_id<'db>(
&'db self,
macro_call_id: MacroCallId<'db>,
) -> Maybe<ItemInlineMacro<'db>>
fn module_macro_call_by_id<'db>( &'db self, macro_call_id: MacroCallId<'db>, ) -> Maybe<ItemInlineMacro<'db>>
Returns the macro call by its ID.
Sourcefn module_ancestors<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> &'db OrderedHashSet<ModuleId<'db>>
fn module_ancestors<'db>( &'db self, module_id: ModuleId<'db>, ) -> &'db OrderedHashSet<ModuleId<'db>>
Returns the ancestors of a module.
Sourcefn module_perceived_module<'db>(
&'db self,
module_id: ModuleId<'db>,
) -> ModuleId<'db>
fn module_perceived_module<'db>( &'db self, module_id: ModuleId<'db>, ) -> ModuleId<'db>
Returns the module that the module is perceives as. Specifically if this is a macro call, it returns the module that the macro call was called from, including recursive calls.