Trait ra_ap_hir::db::DefDatabase[][src]

pub trait DefDatabase: Database + HasQueryGroup<DefDatabaseStorage> + InternDatabase + AstDatabase + Upcast<dyn AstDatabase + 'static> {
Show methods fn enable_proc_attr_macros(&self) -> bool;
fn set_enable_proc_attr_macros(&mut self, value__: bool);
fn set_enable_proc_attr_macros_with_durability(
        &mut self,
        value__: bool,
        durability__: Durability
    );
fn file_item_tree(&self, key0: HirFileId) -> Arc<ItemTree>;
fn crate_def_map(&self, key0: CrateId) -> Arc<DefMap>;
fn crate_def_map_query(&self, key0: CrateId) -> Arc<DefMap>;
fn block_def_map(&self, key0: BlockId) -> Option<Arc<DefMap>>;
fn struct_data(&self, key0: StructId) -> Arc<StructData>;
fn union_data(&self, key0: UnionId) -> Arc<StructData>;
fn enum_data(&self, key0: EnumId) -> Arc<EnumData>;
fn impl_data(&self, key0: ImplId) -> Arc<ImplData>;
fn trait_data(&self, key0: TraitId) -> Arc<TraitData>;
fn type_alias_data(&self, key0: TypeAliasId) -> Arc<TypeAliasData>;
fn function_data(&self, key0: FunctionId) -> Arc<FunctionData>;
fn const_data(&self, key0: ConstId) -> Arc<ConstData>;
fn static_data(&self, key0: StaticId) -> Arc<StaticData>;
fn body_with_source_map(
        &self,
        key0: DefWithBodyId
    ) -> (Arc<Body>, Arc<BodySourceMap>);
fn body(&self, key0: DefWithBodyId) -> Arc<Body>;
fn expr_scopes(&self, key0: DefWithBodyId) -> Arc<ExprScopes>;
fn generic_params(&self, key0: GenericDefId) -> Interned<GenericParams>;
fn variants_attrs(
        &self,
        key0: EnumId
    ) -> Arc<ArenaMap<Idx<EnumVariantData>, Attrs>>;
fn fields_attrs(
        &self,
        key0: VariantId
    ) -> Arc<ArenaMap<Idx<FieldData>, Attrs>>;
fn variants_attrs_source_map(
        &self,
        key0: EnumId
    ) -> Arc<ArenaMap<Idx<EnumVariantData>, AstPtr<Variant>>>;
fn fields_attrs_source_map(
        &self,
        key0: VariantId
    ) -> Arc<ArenaMap<Idx<FieldData>, Either<AstPtr<TupleField>, AstPtr<RecordField>>>>;
fn attrs(&self, key0: AttrDefId) -> AttrsWithOwner;
fn crate_lang_items(&self, key0: CrateId) -> Arc<LangItems>;
fn lang_item(&self, key0: CrateId, key1: SmolStr) -> Option<LangItemTarget>;
fn import_map(&self, key0: CrateId) -> Arc<ImportMap>;
fn field_visibilities(
        &self,
        key0: VariantId
    ) -> Arc<ArenaMap<Idx<FieldData>, Visibility>>;
fn function_visibility(&self, key0: FunctionId) -> Visibility;
}

Required methods

Set the value of the enable_proc_attr_macros input.

See enable_proc_attr_macros for details.

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

Set the value of the enable_proc_attr_macros input and promise that its value will never change again.

See enable_proc_attr_macros for details.

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

Computes the block-level DefMap, returning None when block doesn’t contain any inner items directly.

For example:

fn f() { // (0)
    { // (1)
        fn inner() {}
    }
}

The block_def_map for block 0 would return None, while block_def_map of block 1 would return a DefMap containing inner.

Implementors