Trait hir_def::db::DefDatabase

source ·
pub trait DefDatabase:
    Database
    + HasQueryGroup<DefDatabaseStorage>
    + InternDatabase
    + ExpandDatabase
    + Upcast<dyn ExpandDatabase> {
Show 50 methods // Required methods fn expand_proc_attr_macros(&self) -> bool; fn set_expand_proc_attr_macros(&mut self, value__: bool); fn set_expand_proc_attr_macros_with_durability( &mut self, value__: bool, durability__: Durability, ); fn file_item_tree(&self, file_id: HirFileId) -> Arc<ItemTree>; fn block_item_tree(&self, block_id: BlockId) -> Arc<ItemTree>; fn file_item_tree_with_source_map( &self, file_id: HirFileId, ) -> (Arc<ItemTree>, Arc<ItemTreeSourceMaps>); fn block_item_tree_with_source_map( &self, block_id: BlockId, ) -> (Arc<ItemTree>, Arc<ItemTreeSourceMaps>); fn crate_def_map(&self, krate: CrateId) -> Arc<DefMap>; fn block_def_map(&self, block: BlockId) -> Arc<DefMap>; fn macro_def(&self, m: MacroId) -> MacroDefId; fn struct_data(&self, id: StructId) -> Arc<StructData>; fn struct_data_with_diagnostics( &self, id: StructId, ) -> (Arc<StructData>, DefDiagnostics); fn union_data(&self, id: UnionId) -> Arc<StructData>; fn union_data_with_diagnostics( &self, id: UnionId, ) -> (Arc<StructData>, DefDiagnostics); fn enum_data(&self, e: EnumId) -> Arc<EnumData>; fn enum_variant_data(&self, id: EnumVariantId) -> Arc<EnumVariantData>; fn enum_variant_data_with_diagnostics( &self, id: EnumVariantId, ) -> (Arc<EnumVariantData>, DefDiagnostics); fn variant_data(&self, id: VariantId) -> Arc<VariantData>; fn impl_data(&self, e: ImplId) -> Arc<ImplData>; fn impl_data_with_diagnostics( &self, e: ImplId, ) -> (Arc<ImplData>, DefDiagnostics); fn trait_data(&self, e: TraitId) -> Arc<TraitData>; fn trait_data_with_diagnostics( &self, tr: TraitId, ) -> (Arc<TraitData>, DefDiagnostics); fn trait_alias_data(&self, e: TraitAliasId) -> Arc<TraitAliasData>; fn type_alias_data(&self, e: TypeAliasId) -> Arc<TypeAliasData>; fn function_data(&self, func: FunctionId) -> Arc<FunctionData>; fn const_data(&self, konst: ConstId) -> Arc<ConstData>; fn static_data(&self, statik: StaticId) -> Arc<StaticData>; fn macro2_data(&self, makro: Macro2Id) -> Arc<Macro2Data>; fn macro_rules_data(&self, makro: MacroRulesId) -> Arc<MacroRulesData>; fn proc_macro_data(&self, makro: ProcMacroId) -> Arc<ProcMacroData>; fn extern_crate_decl_data( &self, extern_crate: ExternCrateId, ) -> Arc<ExternCrateDeclData>; fn body_with_source_map( &self, def: DefWithBodyId, ) -> (Arc<Body>, Arc<BodySourceMap>); fn body(&self, def: DefWithBodyId) -> Arc<Body>; fn expr_scopes(&self, def: DefWithBodyId) -> Arc<ExprScopes>; fn generic_params(&self, def: GenericDefId) -> Arc<GenericParams>; fn generic_params_with_source_map( &self, def: GenericDefId, ) -> (Arc<GenericParams>, Option<Arc<TypesSourceMap>>); fn fields_attrs(&self, def: VariantId) -> Arc<ArenaMap<LocalFieldId, Attrs>>; fn fields_attrs_source_map( &self, def: VariantId, ) -> Arc<ArenaMap<LocalFieldId, AstPtr<Either<TupleField, RecordField>>>>; fn attrs(&self, def: AttrDefId) -> Attrs; fn lang_attr(&self, def: AttrDefId) -> Option<LangItem>; fn lang_item( &self, start_crate: CrateId, item: LangItem, ) -> Option<LangItemTarget>; fn import_map(&self, krate: CrateId) -> Arc<ImportMap>; fn field_visibilities( &self, var: VariantId, ) -> Arc<ArenaMap<LocalFieldId, Visibility>>; fn function_visibility(&self, def: FunctionId) -> Visibility; fn const_visibility(&self, def: ConstId) -> Visibility; fn crate_lang_items(&self, krate: CrateId) -> Option<Arc<LangItems>>; fn notable_traits_in_deps(&self, krate: CrateId) -> Arc<[Arc<[TraitId]>]>; fn crate_notable_traits(&self, krate: CrateId) -> Option<Arc<[TraitId]>>; fn crate_supports_no_std(&self, crate_id: CrateId) -> bool; fn include_macro_invoc( &self, crate_id: CrateId, ) -> Arc<[(MacroCallId, EditionedFileId)]>;
}

Required Methods§

source

fn expand_proc_attr_macros(&self) -> bool

Whether to expand procedural macros during name resolution.

source

fn set_expand_proc_attr_macros(&mut self, value__: bool)

Set the value of the expand_proc_attr_macros input.

See expand_proc_attr_macros for details.

Note: Setting values will trigger cancellation of any ongoing queries; this method blocks until those queries have been cancelled.

source

fn set_expand_proc_attr_macros_with_durability( &mut self, value__: bool, durability__: Durability, )

Set the value of the expand_proc_attr_macros 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 expand_proc_attr_macros for details.

Note: Setting values will trigger cancellation of any ongoing queries; this method blocks until those queries have been cancelled.

source

fn file_item_tree(&self, file_id: HirFileId) -> Arc<ItemTree>

Computes an ItemTree for the given file or macro expansion.

source

fn block_item_tree(&self, block_id: BlockId) -> Arc<ItemTree>

source

fn file_item_tree_with_source_map( &self, file_id: HirFileId, ) -> (Arc<ItemTree>, Arc<ItemTreeSourceMaps>)

source

fn block_item_tree_with_source_map( &self, block_id: BlockId, ) -> (Arc<ItemTree>, Arc<ItemTreeSourceMaps>)

source

fn crate_def_map(&self, krate: CrateId) -> Arc<DefMap>

source

fn block_def_map(&self, block: BlockId) -> Arc<DefMap>

Computes the block-level DefMap.

source

fn macro_def(&self, m: MacroId) -> MacroDefId

Turns a MacroId into a MacroDefId, describing the macro’s definition post name resolution.

source

fn struct_data(&self, id: StructId) -> Arc<StructData>

source

fn struct_data_with_diagnostics( &self, id: StructId, ) -> (Arc<StructData>, DefDiagnostics)

source

fn union_data(&self, id: UnionId) -> Arc<StructData>

source

fn union_data_with_diagnostics( &self, id: UnionId, ) -> (Arc<StructData>, DefDiagnostics)

source

fn enum_data(&self, e: EnumId) -> Arc<EnumData>

source

fn enum_variant_data(&self, id: EnumVariantId) -> Arc<EnumVariantData>

source

fn enum_variant_data_with_diagnostics( &self, id: EnumVariantId, ) -> (Arc<EnumVariantData>, DefDiagnostics)

source

fn variant_data(&self, id: VariantId) -> Arc<VariantData>

source

fn impl_data(&self, e: ImplId) -> Arc<ImplData>

source

fn impl_data_with_diagnostics( &self, e: ImplId, ) -> (Arc<ImplData>, DefDiagnostics)

source

fn trait_data(&self, e: TraitId) -> Arc<TraitData>

source

fn trait_data_with_diagnostics( &self, tr: TraitId, ) -> (Arc<TraitData>, DefDiagnostics)

source

fn trait_alias_data(&self, e: TraitAliasId) -> Arc<TraitAliasData>

source

fn type_alias_data(&self, e: TypeAliasId) -> Arc<TypeAliasData>

source

fn function_data(&self, func: FunctionId) -> Arc<FunctionData>

source

fn const_data(&self, konst: ConstId) -> Arc<ConstData>

source

fn static_data(&self, statik: StaticId) -> Arc<StaticData>

source

fn macro2_data(&self, makro: Macro2Id) -> Arc<Macro2Data>

source

fn macro_rules_data(&self, makro: MacroRulesId) -> Arc<MacroRulesData>

source

fn proc_macro_data(&self, makro: ProcMacroId) -> Arc<ProcMacroData>

source

fn extern_crate_decl_data( &self, extern_crate: ExternCrateId, ) -> Arc<ExternCrateDeclData>

source

fn body_with_source_map( &self, def: DefWithBodyId, ) -> (Arc<Body>, Arc<BodySourceMap>)

source

fn body(&self, def: DefWithBodyId) -> Arc<Body>

source

fn expr_scopes(&self, def: DefWithBodyId) -> Arc<ExprScopes>

source

fn generic_params(&self, def: GenericDefId) -> Arc<GenericParams>

source

fn generic_params_with_source_map( &self, def: GenericDefId, ) -> (Arc<GenericParams>, Option<Arc<TypesSourceMap>>)

If this returns None for the source map, that means it is the same as with the item tree.

source

fn fields_attrs(&self, def: VariantId) -> Arc<ArenaMap<LocalFieldId, Attrs>>

source

fn fields_attrs_source_map( &self, def: VariantId, ) -> Arc<ArenaMap<LocalFieldId, AstPtr<Either<TupleField, RecordField>>>>

source

fn attrs(&self, def: AttrDefId) -> Attrs

source

fn lang_attr(&self, def: AttrDefId) -> Option<LangItem>

source

fn lang_item( &self, start_crate: CrateId, item: LangItem, ) -> Option<LangItemTarget>

source

fn import_map(&self, krate: CrateId) -> Arc<ImportMap>

source

fn field_visibilities( &self, var: VariantId, ) -> Arc<ArenaMap<LocalFieldId, Visibility>>

source

fn function_visibility(&self, def: FunctionId) -> Visibility

source

fn const_visibility(&self, def: ConstId) -> Visibility

source

fn crate_lang_items(&self, krate: CrateId) -> Option<Arc<LangItems>>

source

fn notable_traits_in_deps(&self, krate: CrateId) -> Arc<[Arc<[TraitId]>]>

source

fn crate_notable_traits(&self, krate: CrateId) -> Option<Arc<[TraitId]>>

source

fn crate_supports_no_std(&self, crate_id: CrateId) -> bool

source

fn include_macro_invoc( &self, crate_id: CrateId, ) -> Arc<[(MacroCallId, EditionedFileId)]>

Implementors§

source§

impl<DB> DefDatabase for DB
where DB: InternDatabase + ExpandDatabase + Upcast<dyn ExpandDatabase> + Database + HasQueryGroup<DefDatabaseStorage>,