Struct ra_ap_hir_ty::TyBuilder
source · [−]pub struct TyBuilder<D> { /* private fields */ }
Expand description
This is a builder for Ty
or anything that needs a Substitution
.
Implementations
sourceimpl<D> TyBuilder<D>
impl<D> TyBuilder<D>
pub fn push(self, arg: impl CastTo<GenericArg>) -> Self
pub fn remaining(&self) -> usize
pub fn fill_with_bound_vars(
self,
debruijn: DebruijnIndex,
starting_from: usize
) -> Self
pub fn fill_with_unknown(self) -> Self
pub fn fill(self, filler: impl FnMut(&ParamKind) -> GenericArg) -> Self
pub fn use_parent_substs(self, parent_substs: &Substitution) -> Self
sourceimpl TyBuilder<()>
impl TyBuilder<()>
pub fn unit() -> Ty
pub fn usize() -> Ty
pub fn fn_ptr(sig: CallableSig) -> Ty
pub fn builtin(builtin: BuiltinType) -> Ty
pub fn slice(argument: Ty) -> Ty
pub fn placeholder_subst(
db: &dyn HirDatabase,
def: impl Into<GenericDefId>
) -> Substitution
pub fn subst_for_def(
db: &dyn HirDatabase,
def: impl Into<GenericDefId>
) -> TyBuilder<()>
pub fn build(self) -> Substitution
sourceimpl TyBuilder<AdtId>
impl TyBuilder<AdtId>
pub fn adt(db: &dyn HirDatabase, def: AdtId) -> TyBuilder<AdtId>
pub fn fill_with_defaults(
self,
db: &dyn HirDatabase,
fallback: impl FnMut() -> Ty
) -> Self
pub fn build(self) -> Ty
sourceimpl TyBuilder<TypeAliasId>
impl TyBuilder<TypeAliasId>
pub fn assoc_type_projection(
db: &dyn HirDatabase,
def: TypeAliasId
) -> TyBuilder<TypeAliasId>
pub fn build(self) -> ProjectionTy
sourceimpl<T: HasInterner<Interner = Interner> + TypeFoldable<Interner>> TyBuilder<Binders<T>>
impl<T: HasInterner<Interner = Interner> + TypeFoldable<Interner>> TyBuilder<Binders<T>>
sourceimpl TyBuilder<Binders<Ty>>
impl TyBuilder<Binders<Ty>>
pub fn def_ty(db: &dyn HirDatabase, def: TyDefId) -> TyBuilder<Binders<Ty>>
pub fn impl_self_ty(db: &dyn HirDatabase, def: ImplId) -> TyBuilder<Binders<Ty>>
pub fn value_ty(
db: &dyn HirDatabase,
def: ValueTyDefId
) -> TyBuilder<Binders<Ty>>
Auto Trait Implementations
impl<D> RefUnwindSafe for TyBuilder<D> where
D: RefUnwindSafe,
impl<D> Send for TyBuilder<D> where
D: Send,
impl<D> Sync for TyBuilder<D> where
D: Sync,
impl<D> Unpin for TyBuilder<D> where
D: Unpin,
impl<D> UnwindSafe for TyBuilder<D> where
D: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Cast for T
impl<T> Cast for T
sourcefn cast<U>(self, interner: <U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: <U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
Cast a value to type U
using CastTo
.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more