pub trait DefsGroup:
Database
+ HasQueryGroup<DefsDatabase>
+ FilesGroup
+ SyntaxGroup
+ Upcast<dyn SyntaxGroup>
+ ParserGroup
+ Upcast<dyn FilesGroup> {
Show 111 methods
// Required methods
fn intern_constant(&self, id: ConstantLongId) -> ConstantId;
fn lookup_intern_constant(&self, key: ConstantId) -> ConstantLongId;
fn intern_submodule(&self, id: SubmoduleLongId) -> SubmoduleId;
fn lookup_intern_submodule(&self, key: SubmoduleId) -> SubmoduleLongId;
fn intern_use(&self, id: UseLongId) -> UseId;
fn lookup_intern_use(&self, key: UseId) -> UseLongId;
fn intern_free_function(&self, id: FreeFunctionLongId) -> FreeFunctionId;
fn lookup_intern_free_function(
&self,
key: FreeFunctionId,
) -> FreeFunctionLongId;
fn intern_impl_type_def(&self, id: ImplTypeDefLongId) -> ImplTypeDefId;
fn lookup_intern_impl_type_def(
&self,
key: ImplTypeDefId,
) -> ImplTypeDefLongId;
fn intern_impl_constant_def(
&self,
id: ImplConstantDefLongId,
) -> ImplConstantDefId;
fn lookup_intern_impl_constant_def(
&self,
key: ImplConstantDefId,
) -> ImplConstantDefLongId;
fn intern_impl_impl_def(&self, id: ImplImplDefLongId) -> ImplImplDefId;
fn lookup_intern_impl_impl_def(
&self,
key: ImplImplDefId,
) -> ImplImplDefLongId;
fn intern_impl_function(&self, id: ImplFunctionLongId) -> ImplFunctionId;
fn lookup_intern_impl_function(
&self,
key: ImplFunctionId,
) -> ImplFunctionLongId;
fn intern_struct(&self, id: StructLongId) -> StructId;
fn lookup_intern_struct(&self, key: StructId) -> StructLongId;
fn intern_enum(&self, id: EnumLongId) -> EnumId;
fn lookup_intern_enum(&self, key: EnumId) -> EnumLongId;
fn intern_module_type_alias(
&self,
id: ModuleTypeAliasLongId,
) -> ModuleTypeAliasId;
fn lookup_intern_module_type_alias(
&self,
key: ModuleTypeAliasId,
) -> ModuleTypeAliasLongId;
fn intern_impl_alias(&self, id: ImplAliasLongId) -> ImplAliasId;
fn lookup_intern_impl_alias(&self, key: ImplAliasId) -> ImplAliasLongId;
fn intern_member(&self, id: MemberLongId) -> MemberId;
fn lookup_intern_member(&self, key: MemberId) -> MemberLongId;
fn intern_variant(&self, id: VariantLongId) -> VariantId;
fn lookup_intern_variant(&self, key: VariantId) -> VariantLongId;
fn intern_trait(&self, id: TraitLongId) -> TraitId;
fn lookup_intern_trait(&self, key: TraitId) -> TraitLongId;
fn intern_trait_type(&self, id: TraitTypeLongId) -> TraitTypeId;
fn lookup_intern_trait_type(&self, key: TraitTypeId) -> TraitTypeLongId;
fn intern_trait_constant(&self, id: TraitConstantLongId) -> TraitConstantId;
fn lookup_intern_trait_constant(
&self,
key: TraitConstantId,
) -> TraitConstantLongId;
fn intern_trait_impl(&self, id: TraitImplLongId) -> TraitImplId;
fn lookup_intern_trait_impl(&self, key: TraitImplId) -> TraitImplLongId;
fn intern_trait_function(&self, id: TraitFunctionLongId) -> TraitFunctionId;
fn lookup_intern_trait_function(
&self,
key: TraitFunctionId,
) -> TraitFunctionLongId;
fn intern_impl_def(&self, id: ImplDefLongId) -> ImplDefId;
fn lookup_intern_impl_def(&self, key: ImplDefId) -> ImplDefLongId;
fn intern_extern_type(&self, id: ExternTypeLongId) -> ExternTypeId;
fn lookup_intern_extern_type(&self, key: ExternTypeId) -> ExternTypeLongId;
fn intern_extern_function(
&self,
id: ExternFunctionLongId,
) -> ExternFunctionId;
fn lookup_intern_extern_function(
&self,
key: ExternFunctionId,
) -> ExternFunctionLongId;
fn intern_param(&self, id: ParamLongId) -> ParamId;
fn lookup_intern_param(&self, key: ParamId) -> ParamLongId;
fn intern_generic_param(&self, id: GenericParamLongId) -> GenericParamId;
fn lookup_intern_generic_param(
&self,
key: GenericParamId,
) -> GenericParamLongId;
fn intern_local_var(&self, id: LocalVarLongId) -> LocalVarId;
fn lookup_intern_local_var(&self, key: LocalVarId) -> LocalVarLongId;
fn intern_plugin_generated_file(
&self,
id: PluginGeneratedFileLongId,
) -> PluginGeneratedFileId;
fn lookup_intern_plugin_generated_file(
&self,
key: PluginGeneratedFileId,
) -> PluginGeneratedFileLongId;
fn macro_plugins(&self) -> Vec<Arc<dyn MacroPlugin>>;
fn set_macro_plugins(&mut self, value__: Vec<Arc<dyn MacroPlugin>>);
fn set_macro_plugins_with_durability(
&mut self,
value__: Vec<Arc<dyn MacroPlugin>>,
durability__: Durability,
);
fn inline_macro_plugins(
&self,
) -> Arc<OrderedHashMap<String, Arc<dyn InlineMacroExprPlugin>>>;
fn set_inline_macro_plugins(
&mut self,
value__: Arc<OrderedHashMap<String, Arc<dyn InlineMacroExprPlugin>>>,
);
fn set_inline_macro_plugins_with_durability(
&mut self,
value__: Arc<OrderedHashMap<String, Arc<dyn InlineMacroExprPlugin>>>,
durability__: Durability,
);
fn allowed_attributes(&self) -> Arc<OrderedHashSet<String>>;
fn allowed_statement_attributes(&self) -> Arc<OrderedHashSet<String>>;
fn declared_derives(&self) -> Arc<OrderedHashSet<String>>;
fn declared_phantom_type_attributes(&self) -> Arc<OrderedHashSet<String>>;
fn module_main_file(&self, module_id: ModuleId) -> Maybe<FileId>;
fn module_files(&self, module_id: ModuleId) -> Maybe<Arc<[FileId]>>;
fn module_file(&self, module_id: ModuleFileId) -> Maybe<FileId>;
fn module_dir(&self, module_id: ModuleId) -> Maybe<Directory>;
fn crate_modules(&self, crate_id: CrateId) -> Arc<[ModuleId]>;
fn priv_file_to_module_mapping(
&self,
) -> Arc<OrderedHashMap<FileId, Vec<ModuleId>>>;
fn file_modules(&self, file_id: FileId) -> Maybe<Arc<[ModuleId]>>;
fn priv_module_data(&self, module_id: ModuleId) -> Maybe<ModuleData>;
fn priv_module_sub_files(
&self,
module_id: ModuleId,
file_id: FileId,
) -> Maybe<Arc<PrivModuleSubFiles>>;
fn module_submodules(
&self,
module_id: ModuleId,
) -> Maybe<Arc<OrderedHashMap<SubmoduleId, ItemModule>>>;
fn module_submodules_ids(
&self,
module_id: ModuleId,
) -> Maybe<Arc<[SubmoduleId]>>;
fn module_constants(
&self,
module_id: ModuleId,
) -> Maybe<Arc<OrderedHashMap<ConstantId, ItemConstant>>>;
fn module_constants_ids(
&self,
module_id: ModuleId,
) -> Maybe<Arc<[ConstantId]>>;
fn module_constant_by_id(
&self,
constant_id: ConstantId,
) -> Maybe<Option<ItemConstant>>;
fn module_free_functions(
&self,
module_id: ModuleId,
) -> Maybe<Arc<OrderedHashMap<FreeFunctionId, FunctionWithBody>>>;
fn module_free_functions_ids(
&self,
module_id: ModuleId,
) -> Maybe<Arc<[FreeFunctionId]>>;
fn module_free_function_by_id(
&self,
free_function_id: FreeFunctionId,
) -> Maybe<Option<FunctionWithBody>>;
fn module_items(&self, module_id: ModuleId) -> Maybe<Arc<[ModuleItemId]>>;
fn module_item_name_stable_ptr(
&self,
module_id: ModuleId,
item_id: ModuleItemId,
) -> Maybe<SyntaxStablePtrId>;
fn module_uses(
&self,
module_id: ModuleId,
) -> Maybe<Arc<OrderedHashMap<UseId, UsePathLeaf>>>;
fn module_uses_ids(&self, module_id: ModuleId) -> Maybe<Arc<[UseId]>>;
fn module_use_by_id(&self, use_id: UseId) -> Maybe<Option<UsePathLeaf>>;
fn module_structs(
&self,
module_id: ModuleId,
) -> Maybe<Arc<OrderedHashMap<StructId, ItemStruct>>>;
fn module_structs_ids(&self, module_id: ModuleId) -> Maybe<Arc<[StructId]>>;
fn module_struct_by_id(
&self,
struct_id: StructId,
) -> Maybe<Option<ItemStruct>>;
fn module_enums(
&self,
module_id: ModuleId,
) -> Maybe<Arc<OrderedHashMap<EnumId, ItemEnum>>>;
fn module_enums_ids(&self, module_id: ModuleId) -> Maybe<Arc<[EnumId]>>;
fn module_enum_by_id(&self, enum_id: EnumId) -> Maybe<Option<ItemEnum>>;
fn module_type_aliases(
&self,
module_id: ModuleId,
) -> Maybe<Arc<OrderedHashMap<ModuleTypeAliasId, ItemTypeAlias>>>;
fn module_type_aliases_ids(
&self,
module_id: ModuleId,
) -> Maybe<Arc<[ModuleTypeAliasId]>>;
fn module_type_alias_by_id(
&self,
module_type_alias_id: ModuleTypeAliasId,
) -> Maybe<Option<ItemTypeAlias>>;
fn module_impl_aliases(
&self,
module_id: ModuleId,
) -> Maybe<Arc<OrderedHashMap<ImplAliasId, ItemImplAlias>>>;
fn module_impl_aliases_ids(
&self,
module_id: ModuleId,
) -> Maybe<Arc<[ImplAliasId]>>;
fn module_impl_alias_by_id(
&self,
impl_alias_id: ImplAliasId,
) -> Maybe<Option<ItemImplAlias>>;
fn module_traits(
&self,
module_id: ModuleId,
) -> Maybe<Arc<OrderedHashMap<TraitId, ItemTrait>>>;
fn module_traits_ids(&self, module_id: ModuleId) -> Maybe<Arc<[TraitId]>>;
fn module_trait_by_id(&self, trait_id: TraitId) -> Maybe<Option<ItemTrait>>;
fn module_impls(
&self,
module_id: ModuleId,
) -> Maybe<Arc<OrderedHashMap<ImplDefId, ItemImpl>>>;
fn module_impls_ids(&self, module_id: ModuleId) -> Maybe<Arc<[ImplDefId]>>;
fn module_impl_by_id(&self, impl_id: ImplDefId) -> Maybe<Option<ItemImpl>>;
fn module_extern_types(
&self,
module_id: ModuleId,
) -> Maybe<Arc<OrderedHashMap<ExternTypeId, ItemExternType>>>;
fn module_extern_types_ids(
&self,
module_id: ModuleId,
) -> Maybe<Arc<[ExternTypeId]>>;
fn module_extern_type_by_id(
&self,
extern_type_id: ExternTypeId,
) -> Maybe<Option<ItemExternType>>;
fn module_extern_functions(
&self,
module_id: ModuleId,
) -> Maybe<Arc<OrderedHashMap<ExternFunctionId, ItemExternFunction>>>;
fn module_extern_functions_ids(
&self,
module_id: ModuleId,
) -> Maybe<Arc<[ExternFunctionId]>>;
fn module_extern_function_by_id(
&self,
extern_function_id: ExternFunctionId,
) -> Maybe<Option<ItemExternFunction>>;
fn module_ancestors(&self, module_id: ModuleId) -> OrderedHashSet<ModuleId>;
fn module_generated_file_aux_data(
&self,
module_id: ModuleId,
) -> Maybe<Arc<[Option<DynGeneratedFileAuxData>]>>;
fn module_plugin_diagnostics(
&self,
module_id: ModuleId,
) -> Maybe<Arc<[(ModuleFileId, PluginDiagnostic)]>>;
}
Expand description
Salsa database interface.
See super::ids
for further details.
Required Methods§
fn intern_constant(&self, id: ConstantLongId) -> ConstantId
fn lookup_intern_constant(&self, key: ConstantId) -> ConstantLongId
fn intern_submodule(&self, id: SubmoduleLongId) -> SubmoduleId
fn lookup_intern_submodule(&self, key: SubmoduleId) -> SubmoduleLongId
fn intern_use(&self, id: UseLongId) -> UseId
fn lookup_intern_use(&self, key: UseId) -> UseLongId
fn intern_free_function(&self, id: FreeFunctionLongId) -> FreeFunctionId
fn lookup_intern_free_function(&self, key: FreeFunctionId) -> FreeFunctionLongId
fn intern_impl_type_def(&self, id: ImplTypeDefLongId) -> ImplTypeDefId
fn lookup_intern_impl_type_def(&self, key: ImplTypeDefId) -> ImplTypeDefLongId
fn intern_impl_constant_def( &self, id: ImplConstantDefLongId, ) -> ImplConstantDefId
fn lookup_intern_impl_constant_def( &self, key: ImplConstantDefId, ) -> ImplConstantDefLongId
fn intern_impl_impl_def(&self, id: ImplImplDefLongId) -> ImplImplDefId
fn lookup_intern_impl_impl_def(&self, key: ImplImplDefId) -> ImplImplDefLongId
fn intern_impl_function(&self, id: ImplFunctionLongId) -> ImplFunctionId
fn lookup_intern_impl_function(&self, key: ImplFunctionId) -> ImplFunctionLongId
fn intern_struct(&self, id: StructLongId) -> StructId
fn lookup_intern_struct(&self, key: StructId) -> StructLongId
fn intern_enum(&self, id: EnumLongId) -> EnumId
fn lookup_intern_enum(&self, key: EnumId) -> EnumLongId
fn intern_module_type_alias( &self, id: ModuleTypeAliasLongId, ) -> ModuleTypeAliasId
fn lookup_intern_module_type_alias( &self, key: ModuleTypeAliasId, ) -> ModuleTypeAliasLongId
fn intern_impl_alias(&self, id: ImplAliasLongId) -> ImplAliasId
fn lookup_intern_impl_alias(&self, key: ImplAliasId) -> ImplAliasLongId
fn intern_member(&self, id: MemberLongId) -> MemberId
fn lookup_intern_member(&self, key: MemberId) -> MemberLongId
fn intern_variant(&self, id: VariantLongId) -> VariantId
fn lookup_intern_variant(&self, key: VariantId) -> VariantLongId
fn intern_trait(&self, id: TraitLongId) -> TraitId
fn lookup_intern_trait(&self, key: TraitId) -> TraitLongId
fn intern_trait_type(&self, id: TraitTypeLongId) -> TraitTypeId
fn lookup_intern_trait_type(&self, key: TraitTypeId) -> TraitTypeLongId
fn intern_trait_constant(&self, id: TraitConstantLongId) -> TraitConstantId
fn lookup_intern_trait_constant( &self, key: TraitConstantId, ) -> TraitConstantLongId
fn intern_trait_impl(&self, id: TraitImplLongId) -> TraitImplId
fn lookup_intern_trait_impl(&self, key: TraitImplId) -> TraitImplLongId
fn intern_trait_function(&self, id: TraitFunctionLongId) -> TraitFunctionId
fn lookup_intern_trait_function( &self, key: TraitFunctionId, ) -> TraitFunctionLongId
fn intern_impl_def(&self, id: ImplDefLongId) -> ImplDefId
fn lookup_intern_impl_def(&self, key: ImplDefId) -> ImplDefLongId
fn intern_extern_type(&self, id: ExternTypeLongId) -> ExternTypeId
fn lookup_intern_extern_type(&self, key: ExternTypeId) -> ExternTypeLongId
fn intern_extern_function(&self, id: ExternFunctionLongId) -> ExternFunctionId
fn lookup_intern_extern_function( &self, key: ExternFunctionId, ) -> ExternFunctionLongId
fn intern_param(&self, id: ParamLongId) -> ParamId
fn lookup_intern_param(&self, key: ParamId) -> ParamLongId
fn intern_generic_param(&self, id: GenericParamLongId) -> GenericParamId
fn lookup_intern_generic_param(&self, key: GenericParamId) -> GenericParamLongId
fn intern_local_var(&self, id: LocalVarLongId) -> LocalVarId
fn lookup_intern_local_var(&self, key: LocalVarId) -> LocalVarLongId
fn intern_plugin_generated_file( &self, id: PluginGeneratedFileLongId, ) -> PluginGeneratedFileId
fn lookup_intern_plugin_generated_file( &self, key: PluginGeneratedFileId, ) -> PluginGeneratedFileLongId
fn macro_plugins(&self) -> Vec<Arc<dyn MacroPlugin>>
Sourcefn set_macro_plugins(&mut self, value__: Vec<Arc<dyn MacroPlugin>>)
fn set_macro_plugins(&mut self, value__: Vec<Arc<dyn MacroPlugin>>)
Set the value of the macro_plugins
input.
See macro_plugins
for details.
Note: Setting values will trigger cancellation of any ongoing queries; this method blocks until those queries have been cancelled.
Sourcefn set_macro_plugins_with_durability(
&mut self,
value__: Vec<Arc<dyn MacroPlugin>>,
durability__: Durability,
)
fn set_macro_plugins_with_durability( &mut self, value__: Vec<Arc<dyn MacroPlugin>>, durability__: Durability, )
Set the value of the macro_plugins
input with a
specific durability instead of the default of
Durability::LOW
. You can use Durability::MAX
to promise that its value will never change again.
See macro_plugins
for details.
Note: Setting values will trigger cancellation of any ongoing queries; this method blocks until those queries have been cancelled.
fn inline_macro_plugins( &self, ) -> Arc<OrderedHashMap<String, Arc<dyn InlineMacroExprPlugin>>>
Sourcefn set_inline_macro_plugins(
&mut self,
value__: Arc<OrderedHashMap<String, Arc<dyn InlineMacroExprPlugin>>>,
)
fn set_inline_macro_plugins( &mut self, value__: Arc<OrderedHashMap<String, Arc<dyn InlineMacroExprPlugin>>>, )
Set the value of the inline_macro_plugins
input.
See inline_macro_plugins
for details.
Note: Setting values will trigger cancellation of any ongoing queries; this method blocks until those queries have been cancelled.
Sourcefn set_inline_macro_plugins_with_durability(
&mut self,
value__: Arc<OrderedHashMap<String, Arc<dyn InlineMacroExprPlugin>>>,
durability__: Durability,
)
fn set_inline_macro_plugins_with_durability( &mut self, value__: Arc<OrderedHashMap<String, Arc<dyn InlineMacroExprPlugin>>>, durability__: Durability, )
Set the value of the inline_macro_plugins
input with a
specific durability instead of the default of
Durability::LOW
. You can use Durability::MAX
to promise that its value will never change again.
See inline_macro_plugins
for details.
Note: Setting values will trigger cancellation of any ongoing queries; this method blocks until those queries have been cancelled.
Sourcefn allowed_attributes(&self) -> Arc<OrderedHashSet<String>>
fn allowed_attributes(&self) -> Arc<OrderedHashSet<String>>
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(&self) -> Arc<OrderedHashSet<String>>
fn allowed_statement_attributes(&self) -> Arc<OrderedHashSet<String>>
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(&self) -> Arc<OrderedHashSet<String>>
fn declared_derives(&self) -> Arc<OrderedHashSet<String>>
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(&self) -> Arc<OrderedHashSet<String>>
fn declared_phantom_type_attributes(&self) -> Arc<OrderedHashSet<String>>
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 module_main_file(&self, module_id: ModuleId) -> Maybe<FileId>
fn module_main_file(&self, module_id: ModuleId) -> Maybe<FileId>
Gets the main file of the module. A module might have more virtual files generated by plugins.
Sourcefn module_files(&self, module_id: ModuleId) -> Maybe<Arc<[FileId]>>
fn module_files(&self, module_id: ModuleId) -> Maybe<Arc<[FileId]>>
Gets all the files of a module - main files and generated virtual files.
Sourcefn module_file(&self, module_id: ModuleFileId) -> Maybe<FileId>
fn module_file(&self, module_id: ModuleFileId) -> Maybe<FileId>
Gets a file from a module and a FileIndex (i.e. ModuleFileId).
Sourcefn module_dir(&self, module_id: ModuleId) -> Maybe<Directory>
fn module_dir(&self, module_id: ModuleId) -> Maybe<Directory>
Gets the directory of a module.
fn crate_modules(&self, crate_id: CrateId) -> Arc<[ModuleId]>
fn priv_file_to_module_mapping( &self, ) -> Arc<OrderedHashMap<FileId, Vec<ModuleId>>>
fn file_modules(&self, file_id: FileId) -> Maybe<Arc<[ModuleId]>>
fn priv_module_data(&self, module_id: ModuleId) -> Maybe<ModuleData>
fn priv_module_sub_files( &self, module_id: ModuleId, file_id: FileId, ) -> Maybe<Arc<PrivModuleSubFiles>>
fn module_submodules( &self, module_id: ModuleId, ) -> Maybe<Arc<OrderedHashMap<SubmoduleId, ItemModule>>>
fn module_submodules_ids( &self, module_id: ModuleId, ) -> Maybe<Arc<[SubmoduleId]>>
fn module_constants( &self, module_id: ModuleId, ) -> Maybe<Arc<OrderedHashMap<ConstantId, ItemConstant>>>
fn module_constants_ids(&self, module_id: ModuleId) -> Maybe<Arc<[ConstantId]>>
fn module_constant_by_id( &self, constant_id: ConstantId, ) -> Maybe<Option<ItemConstant>>
fn module_free_functions( &self, module_id: ModuleId, ) -> Maybe<Arc<OrderedHashMap<FreeFunctionId, FunctionWithBody>>>
fn module_free_functions_ids( &self, module_id: ModuleId, ) -> Maybe<Arc<[FreeFunctionId]>>
fn module_free_function_by_id( &self, free_function_id: FreeFunctionId, ) -> Maybe<Option<FunctionWithBody>>
fn module_items(&self, module_id: ModuleId) -> Maybe<Arc<[ModuleItemId]>>
Sourcefn module_item_name_stable_ptr(
&self,
module_id: ModuleId,
item_id: ModuleItemId,
) -> Maybe<SyntaxStablePtrId>
fn module_item_name_stable_ptr( &self, module_id: ModuleId, item_id: ModuleItemId, ) -> Maybe<SyntaxStablePtrId>
Returns the stable ptr of the name of a module item.