Trait hir::db::HirDatabase[][src]

pub trait HirDatabase: Database + HasQueryGroup<HirDatabaseStorage> + DefDatabase + Upcast<dyn DefDatabase + 'static> {
Show 41 methods fn infer(&self, def: DefWithBodyId) -> Arc<InferenceResult>;
fn infer_query(&self, def: DefWithBodyId) -> Arc<InferenceResult>;
fn ty(&self, def: TyDefId) -> Binders<Ty<Interner>>;
fn value_ty(&self, def: ValueTyDefId) -> Binders<Ty<Interner>>;
fn impl_self_ty(&self, def: ImplId) -> Binders<Ty<Interner>>;
fn const_param_ty(&self, def: ConstParamId) -> Ty<Interner>;
fn impl_trait(&self, def: ImplId) -> Option<Binders<TraitRef<Interner>>>;
fn field_types(
        &self,
        var: VariantId
    ) -> Arc<ArenaMap<Idx<FieldData>, Binders<Ty<Interner>>>>;
fn callable_item_signature(
        &self,
        def: CallableDefId
    ) -> Binders<CallableSig>;
fn return_type_impl_traits(
        &self,
        def: FunctionId
    ) -> Option<Arc<Binders<ReturnTypeImplTraits>>>;
fn generic_predicates_for_param(
        &self,
        param_id: TypeParamId,
        assoc_name: Option<Name>
    ) -> Arc<[Binders<Binders<WhereClause<Interner>>>]>;
fn generic_predicates(
        &self,
        def: GenericDefId
    ) -> Arc<[Binders<Binders<WhereClause<Interner>>>]>;
fn trait_environment(&self, def: GenericDefId) -> Arc<TraitEnvironment>;
fn generic_defaults(
        &self,
        def: GenericDefId
    ) -> Arc<[Binders<Ty<Interner>>]>;
fn inherent_impls_in_crate(&self, krate: CrateId) -> Arc<InherentImpls>;
fn trait_impls_in_crate(&self, krate: CrateId) -> Arc<TraitImpls>;
fn trait_impls_in_block(&self, krate: BlockId) -> Option<Arc<TraitImpls>>;
fn trait_impls_in_deps(&self, krate: CrateId) -> Arc<TraitImpls>;
fn intern_callable_def(
        &self,
        callable_def: CallableDefId
    ) -> InternedCallableDefId;
fn lookup_intern_callable_def(
        &self,
        key: InternedCallableDefId
    ) -> CallableDefId;
fn intern_type_param_id(&self, param_id: TypeParamId) -> InternedTypeParamId;
fn lookup_intern_type_param_id(
        &self,
        key: InternedTypeParamId
    ) -> TypeParamId;
fn intern_lifetime_param_id(
        &self,
        param_id: LifetimeParamId
    ) -> InternedLifetimeParamId;
fn lookup_intern_lifetime_param_id(
        &self,
        key: InternedLifetimeParamId
    ) -> LifetimeParamId;
fn intern_const_param_id(
        &self,
        param_id: ConstParamId
    ) -> InternedConstParamId;
fn lookup_intern_const_param_id(
        &self,
        key: InternedConstParamId
    ) -> ConstParamId;
fn intern_impl_trait_id(&self, id: ImplTraitId) -> InternedOpaqueTyId;
fn lookup_intern_impl_trait_id(
        &self,
        key: InternedOpaqueTyId
    ) -> ImplTraitId;
fn intern_closure(
        &self,
        id: (DefWithBodyId, Idx<Expr>)
    ) -> InternedClosureId;
fn lookup_intern_closure(
        &self,
        key: InternedClosureId
    ) -> (DefWithBodyId, Idx<Expr>);
fn associated_ty_data(
        &self,
        id: AssocTypeId<Interner>
    ) -> Arc<AssociatedTyDatum<Interner>>;
fn trait_datum(
        &self,
        krate: CrateId,
        trait_id: TraitId<Interner>
    ) -> Arc<TraitDatum<Interner>>;
fn struct_datum(
        &self,
        krate: CrateId,
        struct_id: AdtId<Interner>
    ) -> Arc<AdtDatum<Interner>>;
fn impl_datum(
        &self,
        krate: CrateId,
        impl_id: ImplId<Interner>
    ) -> Arc<ImplDatum<Interner>>;
fn fn_def_datum(
        &self,
        krate: CrateId,
        fn_def_id: FnDefId<Interner>
    ) -> Arc<FnDefDatum<Interner>>;
fn fn_def_variance(
        &self,
        fn_def_id: FnDefId<Interner>
    ) -> Variances<Interner>;
fn adt_variance(&self, adt_id: AdtId<Interner>) -> Variances<Interner>;
fn associated_ty_value(
        &self,
        krate: CrateId,
        id: AssociatedTyValueId<Interner>
    ) -> Arc<AssociatedTyValue<Interner>>;
fn trait_solve(
        &self,
        krate: CrateId,
        goal: Canonical<InEnvironment<Goal<Interner>>>
    ) -> Option<Solution<Interner>>;
fn trait_solve_query(
        &self,
        krate: CrateId,
        goal: Canonical<InEnvironment<Goal<Interner>>>
    ) -> Option<Solution<Interner>>;
fn program_clauses_for_chalk_env(
        &self,
        krate: CrateId,
        env: Environment<Interner>
    ) -> ProgramClauses<Interner>;
}

Required methods

Trait Implementations

Gets the variances for the substitution of a fn def

Gets the variances for the substitution of a adt

Implementors