Skip to main content

HirDatabase

Trait HirDatabase 

pub trait HirDatabase: DefDatabase + Debug {
Show 41 methods // Required methods fn mir_body(&self, def: InferBodyId) -> Result<&MirBody, MirLowerError>; fn mir_body_for_closure( &self, def: InternedClosureId, ) -> Result<&MirBody, MirLowerError>; fn monomorphized_mir_body( &self, def: InferBodyId, subst: StoredGenericArgs, env: StoredParamEnvAndCrate, ) -> Result<&MirBody, MirLowerError>; fn monomorphized_mir_body_for_closure( &self, def: InternedClosureId, subst: StoredGenericArgs, env: StoredParamEnvAndCrate, ) -> Result<&MirBody, MirLowerError>; fn borrowck( &self, def: InferBodyId, ) -> Result<&[BorrowckResult], MirLowerError>; fn const_eval<'db>( &'db self, def: ConstId, subst: GenericArgs<'db>, trait_env: Option<ParamEnvAndCrate<'db>>, ) -> Result<Allocation<'db>, ConstEvalError>; fn anon_const_eval<'db>( &'db self, def: AnonConstId, subst: GenericArgs<'db>, trait_env: Option<ParamEnvAndCrate<'db>>, ) -> Result<Allocation<'db>, ConstEvalError>; fn const_eval_static<'db>( &'db self, def: StaticId, ) -> Result<Allocation<'db>, ConstEvalError>; fn const_eval_discriminant( &self, def: EnumVariantId, ) -> Result<i128, ConstEvalError>; fn lookup_impl_method<'db>( &'db self, env: ParamEnvAndCrate<'db>, func: FunctionId, fn_subst: GenericArgs<'db>, ) -> (Either<FunctionId, (BuiltinDeriveImplId, BuiltinDeriveImplMethod)>, GenericArgs<'db>); fn layout_of_adt( &self, def: AdtId, args: StoredGenericArgs, trait_env: StoredParamEnvAndCrate, ) -> Result<Arc<LayoutData<RustcFieldIdx, RustcEnumVariantIdx>>, LayoutError>; fn layout_of_ty( &self, ty: StoredTy, env: StoredParamEnvAndCrate, ) -> Result<Arc<LayoutData<RustcFieldIdx, RustcEnumVariantIdx>>, LayoutError>; fn target_data_layout( &self, krate: Crate, ) -> Result<&TargetDataLayout, TargetLoadError>; fn dyn_compatibility_of_trait( &self, trait_: TraitId, ) -> Option<DynCompatibilityViolation>; fn ty<'db>(&'db self, def: TyDefId) -> EarlyBinder<DbInterner<'db>, Ty<'db>>; fn type_for_type_alias_with_diagnostics( &self, def: TypeAliasId, ) -> &TyLoweringResult<StoredEarlyBinder<StoredTy>>; fn value_ty<'db>( &'db self, def: ValueTyDefId, ) -> Option<EarlyBinder<DbInterner<'db>, Ty<'db>>>; fn type_for_const<'db>( &'db self, def: ConstId, ) -> EarlyBinder<DbInterner<'db>, Ty<'db>>; fn type_for_const_with_diagnostics( &self, def: ConstId, ) -> &TyLoweringResult<StoredEarlyBinder<StoredTy>>; fn type_for_static<'db>( &'db self, def: StaticId, ) -> EarlyBinder<DbInterner<'db>, Ty<'db>>; fn type_for_static_with_diagnostics( &self, def: StaticId, ) -> &TyLoweringResult<StoredEarlyBinder<StoredTy>>; fn impl_self_ty_with_diagnostics( &self, def: ImplId, ) -> &TyLoweringResult<StoredEarlyBinder<StoredTy>>; fn impl_self_ty<'db>( &'db self, def: ImplId, ) -> EarlyBinder<DbInterner<'db>, Ty<'db>>; fn const_param_types_with_diagnostics( &self, def: GenericDefId, ) -> &TyLoweringResult<ArenaMap<Idx<TypeOrConstParamData>, StoredTy>>; fn const_param_types( &self, def: GenericDefId, ) -> &ArenaMap<Idx<TypeOrConstParamData>, StoredTy>; fn const_param_ty<'db>(&'db self, def: ConstParamId) -> Ty<'db>; fn impl_trait_with_diagnostics( &self, def: ImplId, ) -> &Option<TyLoweringResult<StoredEarlyBinder<StoredTraitRef>>>; fn impl_trait<'db>( &'db self, def: ImplId, ) -> Option<EarlyBinder<DbInterner<'db>, TraitRef<DbInterner<'db>>>>; fn field_types_with_diagnostics( &self, var: VariantId, ) -> &TyLoweringResult<ArenaMap<Idx<FieldData>, StoredEarlyBinder<StoredTy>>>; fn field_types( &self, var: VariantId, ) -> &ArenaMap<Idx<FieldData>, StoredEarlyBinder<StoredTy>>; fn callable_item_signature<'db>( &'db self, def: CallableDefId, ) -> EarlyBinder<DbInterner<'db>, Binder<DbInterner<'db>, FnSig<DbInterner<'db>>>>; fn callable_item_signature_with_diagnostics( &self, def: CallableDefId, ) -> &TyLoweringResult<StoredEarlyBinder<StoredPolyFnSig>>; fn trait_environment<'db>( &'db self, def: ExpressionStoreOwnerId, ) -> ParamEnv<'db>; fn generic_defaults_with_diagnostics( &self, def: GenericDefId, ) -> &TyLoweringResult<GenericDefaults>; fn generic_defaults(&self, def: GenericDefId) -> GenericDefaultsRef<'_>; fn type_alias_bounds_with_diagnostics( &self, type_alias: TypeAliasId, ) -> &TyLoweringResult<TypeAliasBounds<StoredEarlyBinder<StoredClauses>>>; fn type_alias_bounds<'db>( &'db self, type_alias: TypeAliasId, ) -> EarlyBinder<DbInterner<'db>, &'db [Clause<'db>]>; fn type_alias_self_bounds<'db>( &'db self, type_alias: TypeAliasId, ) -> EarlyBinder<DbInterner<'db>, &'db [Clause<'db>]>; fn intern_impl_trait_id(&self, id: ImplTraitId) -> InternedOpaqueTyId; fn variances_of<'db>(&'db self, def: GenericDefId) -> VariancesOf<'db>; fn lookup_intern_impl_trait_id(&self, id: InternedOpaqueTyId) -> ImplTraitId;
}

Required Methods§

fn mir_body(&self, def: InferBodyId) -> Result<&MirBody, MirLowerError>

fn mir_body_for_closure( &self, def: InternedClosureId, ) -> Result<&MirBody, MirLowerError>

fn monomorphized_mir_body( &self, def: InferBodyId, subst: StoredGenericArgs, env: StoredParamEnvAndCrate, ) -> Result<&MirBody, MirLowerError>

fn monomorphized_mir_body_for_closure( &self, def: InternedClosureId, subst: StoredGenericArgs, env: StoredParamEnvAndCrate, ) -> Result<&MirBody, MirLowerError>

fn borrowck(&self, def: InferBodyId) -> Result<&[BorrowckResult], MirLowerError>

fn const_eval<'db>( &'db self, def: ConstId, subst: GenericArgs<'db>, trait_env: Option<ParamEnvAndCrate<'db>>, ) -> Result<Allocation<'db>, ConstEvalError>

fn anon_const_eval<'db>( &'db self, def: AnonConstId, subst: GenericArgs<'db>, trait_env: Option<ParamEnvAndCrate<'db>>, ) -> Result<Allocation<'db>, ConstEvalError>

fn const_eval_static<'db>( &'db self, def: StaticId, ) -> Result<Allocation<'db>, ConstEvalError>

fn const_eval_discriminant( &self, def: EnumVariantId, ) -> Result<i128, ConstEvalError>

fn lookup_impl_method<'db>( &'db self, env: ParamEnvAndCrate<'db>, func: FunctionId, fn_subst: GenericArgs<'db>, ) -> (Either<FunctionId, (BuiltinDeriveImplId, BuiltinDeriveImplMethod)>, GenericArgs<'db>)

fn layout_of_adt( &self, def: AdtId, args: StoredGenericArgs, trait_env: StoredParamEnvAndCrate, ) -> Result<Arc<LayoutData<RustcFieldIdx, RustcEnumVariantIdx>>, LayoutError>

fn layout_of_ty( &self, ty: StoredTy, env: StoredParamEnvAndCrate, ) -> Result<Arc<LayoutData<RustcFieldIdx, RustcEnumVariantIdx>>, LayoutError>

fn target_data_layout( &self, krate: Crate, ) -> Result<&TargetDataLayout, TargetLoadError>

fn dyn_compatibility_of_trait( &self, trait_: TraitId, ) -> Option<DynCompatibilityViolation>

fn ty<'db>(&'db self, def: TyDefId) -> EarlyBinder<DbInterner<'db>, Ty<'db>>

fn type_for_type_alias_with_diagnostics( &self, def: TypeAliasId, ) -> &TyLoweringResult<StoredEarlyBinder<StoredTy>>

fn value_ty<'db>( &'db self, def: ValueTyDefId, ) -> Option<EarlyBinder<DbInterner<'db>, Ty<'db>>>

fn type_for_const<'db>( &'db self, def: ConstId, ) -> EarlyBinder<DbInterner<'db>, Ty<'db>>

fn type_for_const_with_diagnostics( &self, def: ConstId, ) -> &TyLoweringResult<StoredEarlyBinder<StoredTy>>

fn type_for_static<'db>( &'db self, def: StaticId, ) -> EarlyBinder<DbInterner<'db>, Ty<'db>>

fn type_for_static_with_diagnostics( &self, def: StaticId, ) -> &TyLoweringResult<StoredEarlyBinder<StoredTy>>

fn impl_self_ty_with_diagnostics( &self, def: ImplId, ) -> &TyLoweringResult<StoredEarlyBinder<StoredTy>>

fn impl_self_ty<'db>( &'db self, def: ImplId, ) -> EarlyBinder<DbInterner<'db>, Ty<'db>>

fn const_param_types_with_diagnostics( &self, def: GenericDefId, ) -> &TyLoweringResult<ArenaMap<Idx<TypeOrConstParamData>, StoredTy>>

fn const_param_types( &self, def: GenericDefId, ) -> &ArenaMap<Idx<TypeOrConstParamData>, StoredTy>

fn const_param_ty<'db>(&'db self, def: ConstParamId) -> Ty<'db>

fn impl_trait_with_diagnostics( &self, def: ImplId, ) -> &Option<TyLoweringResult<StoredEarlyBinder<StoredTraitRef>>>

fn impl_trait<'db>( &'db self, def: ImplId, ) -> Option<EarlyBinder<DbInterner<'db>, TraitRef<DbInterner<'db>>>>

fn field_types_with_diagnostics( &self, var: VariantId, ) -> &TyLoweringResult<ArenaMap<Idx<FieldData>, StoredEarlyBinder<StoredTy>>>

fn field_types( &self, var: VariantId, ) -> &ArenaMap<Idx<FieldData>, StoredEarlyBinder<StoredTy>>

fn callable_item_signature<'db>( &'db self, def: CallableDefId, ) -> EarlyBinder<DbInterner<'db>, Binder<DbInterner<'db>, FnSig<DbInterner<'db>>>>

fn callable_item_signature_with_diagnostics( &self, def: CallableDefId, ) -> &TyLoweringResult<StoredEarlyBinder<StoredPolyFnSig>>

fn trait_environment<'db>( &'db self, def: ExpressionStoreOwnerId, ) -> ParamEnv<'db>

fn generic_defaults_with_diagnostics( &self, def: GenericDefId, ) -> &TyLoweringResult<GenericDefaults>

fn generic_defaults(&self, def: GenericDefId) -> GenericDefaultsRef<'_>

fn type_alias_bounds_with_diagnostics( &self, type_alias: TypeAliasId, ) -> &TyLoweringResult<TypeAliasBounds<StoredEarlyBinder<StoredClauses>>>

fn type_alias_bounds<'db>( &'db self, type_alias: TypeAliasId, ) -> EarlyBinder<DbInterner<'db>, &'db [Clause<'db>]>

fn type_alias_self_bounds<'db>( &'db self, type_alias: TypeAliasId, ) -> EarlyBinder<DbInterner<'db>, &'db [Clause<'db>]>

fn intern_impl_trait_id(&self, id: ImplTraitId) -> InternedOpaqueTyId

fn variances_of<'db>(&'db self, def: GenericDefId) -> VariancesOf<'db>

fn lookup_intern_impl_trait_id(&self, id: InternedOpaqueTyId) -> ImplTraitId

Implementors§

§

impl<DB> HirDatabase for DB
where DB: DefDatabase + Debug,