Struct ra_ap_hir_ty::TyLoweringContext
source · pub struct TyLoweringContext<'a> {
pub db: &'a dyn HirDatabase,
pub type_param_mode: ParamLoweringMode,
/* private fields */
}
Fields§
§db: &'a dyn HirDatabase
§type_param_mode: ParamLoweringMode
Note: Conceptually, it’s thinkable that we could be in a location where some type params should be represented as placeholders, and others should be converted to variables. I think in practice, this isn’t possible currently, so this should be fine for now.
Implementations§
source§impl<'a> TyLoweringContext<'a>
impl<'a> TyLoweringContext<'a>
pub fn new( db: &'a dyn HirDatabase, resolver: &'a Resolver, owner: TypeOwnerId ) -> Self
pub fn new_maybe_unowned( db: &'a dyn HirDatabase, resolver: &'a Resolver, owner: Option<TypeOwnerId> ) -> Self
pub fn with_debruijn<T>( &self, debruijn: DebruijnIndex, f: impl FnOnce(&TyLoweringContext<'_>) -> T ) -> T
pub fn with_shifted_in<T>( &self, debruijn: DebruijnIndex, f: impl FnOnce(&TyLoweringContext<'_>) -> T ) -> T
pub fn with_impl_trait_mode( self, impl_trait_mode: ImplTraitLoweringMode ) -> Self
pub fn with_type_param_mode(self, type_param_mode: ParamLoweringMode) -> Self
source§impl<'a> TyLoweringContext<'a>
impl<'a> TyLoweringContext<'a>
pub fn lower_ty(&self, type_ref: &TypeRef) -> Ty
pub fn lower_const(&self, const_ref: &ConstRef, const_type: Ty) -> Const
pub fn lower_ty_ext(&self, type_ref: &TypeRef) -> (Ty, Option<TypeNs>)
pub fn lower_lifetime(&self, lifetime: &LifetimeRef) -> Lifetime
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Freeze for TyLoweringContext<'a>
impl<'a> !RefUnwindSafe for TyLoweringContext<'a>
impl<'a> !Send for TyLoweringContext<'a>
impl<'a> !Sync for TyLoweringContext<'a>
impl<'a> Unpin for TyLoweringContext<'a>
impl<'a> !UnwindSafe for TyLoweringContext<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Cast for T
impl<T> Cast for T
source§fn cast<U>(self, interner: <U as HasInterner>::Interner) -> Uwhere
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: <U as HasInterner>::Interner) -> Uwhere
Self: CastTo<U>,
U: HasInterner,
Cast a value to type
U
using CastTo
.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more