Trait HirDatabase
pub trait HirDatabase: DefDatabase + Debug {
Show 35 methods
// Required methods
fn mir_body(
&self,
def: DefWithBodyId,
) -> Result<Arc<MirBody>, MirLowerError>;
fn mir_body_for_closure(
&self,
def: InternedClosureId,
) -> Result<Arc<MirBody>, MirLowerError>;
fn monomorphized_mir_body(
&self,
def: DefWithBodyId,
subst: StoredGenericArgs,
env: StoredParamEnvAndCrate,
) -> Result<Arc<MirBody>, MirLowerError>;
fn monomorphized_mir_body_for_closure(
&self,
def: InternedClosureId,
subst: StoredGenericArgs,
env: StoredParamEnvAndCrate,
) -> Result<Arc<MirBody>, MirLowerError>;
fn borrowck(
&self,
def: DefWithBodyId,
) -> Result<Arc<[BorrowckResult]>, MirLowerError>;
fn const_eval<'db>(
&'db self,
def: ConstId,
subst: GenericArgs<'db>,
trait_env: Option<ParamEnvAndCrate<'db>>,
) -> Result<Const<'db>, ConstEvalError>;
fn const_eval_static<'db>(
&'db self,
def: StaticId,
) -> Result<Const<'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<Arc<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<'db>(
&'db self,
def: TypeAliasId,
) -> (EarlyBinder<DbInterner<'db>, Ty<'db>>, Option<ThinArc<(), TyLoweringDiagnostic>>);
fn value_ty<'db>(
&'db self,
def: ValueTyDefId,
) -> Option<EarlyBinder<DbInterner<'db>, Ty<'db>>>;
fn impl_self_ty_with_diagnostics<'db>(
&'db self,
def: ImplId,
) -> (EarlyBinder<DbInterner<'db>, Ty<'db>>, Option<ThinArc<(), TyLoweringDiagnostic>>);
fn impl_self_ty<'db>(
&'db self,
def: ImplId,
) -> EarlyBinder<DbInterner<'db>, Ty<'db>>;
fn const_param_ty_with_diagnostics<'db>(
&'db self,
def: ConstParamId,
) -> (Ty<'db>, Option<ThinArc<(), TyLoweringDiagnostic>>);
fn const_param_ty_ns<'db>(&'db self, def: ConstParamId) -> Ty<'db>;
fn impl_trait_with_diagnostics<'db>(
&'db self,
def: ImplId,
) -> Option<(EarlyBinder<DbInterner<'db>, TraitRef<DbInterner<'db>>>, Option<ThinArc<(), TyLoweringDiagnostic>>)>;
fn impl_trait<'db>(
&'db self,
def: ImplId,
) -> Option<EarlyBinder<DbInterner<'db>, TraitRef<DbInterner<'db>>>>;
fn field_types_with_diagnostics(
&self,
var: VariantId,
) -> &(ArenaMap<Idx<FieldData>, StoredEarlyBinder<StoredTy>>, Option<ThinArc<(), TyLoweringDiagnostic>>);
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 trait_environment<'db>(
&'db self,
def: ExpressionStoreOwnerId,
) -> ParamEnv<'db>;
fn generic_defaults_with_diagnostics(
&self,
def: GenericDefId,
) -> (GenericDefaults, Option<ThinArc<(), TyLoweringDiagnostic>>);
fn generic_defaults(&self, def: GenericDefId) -> GenericDefaults;
fn intern_impl_trait_id(&self, id: ImplTraitId) -> InternedOpaqueTyId;
fn intern_closure(&self, id: InternedClosure) -> InternedClosureId;
fn intern_coroutine(&self, id: InternedCoroutine) -> InternedCoroutineId;
fn variances_of<'db>(&'db self, def: GenericDefId) -> VariancesOf<'db>;
fn lookup_intern_impl_trait_id(&self, id: InternedOpaqueTyId) -> ImplTraitId;
fn lookup_intern_closure(&self, id: InternedClosureId) -> InternedClosure;
fn lookup_intern_coroutine(
&self,
id: InternedCoroutineId,
) -> InternedCoroutine;
}