Trait chalk_ir::cast::CastTo[][src]

pub trait CastTo<T: HasInterner>: Sized {
    fn cast_to(self, interner: &T::Interner) -> T;
}
Expand description

The “helper” trait for cast that actually implements the transformations. You can also use this if you want to have functions that take (e.g.) an impl CastTo<Goal<_>> or something like that.

Required methods

fn cast_to(self, interner: &T::Interner) -> T[src]

Cast a value to type T.

Implementations on Foreign Types

impl<T, U> CastTo<Option<U>> for Option<T> where
    T: CastTo<U>,
    U: HasInterner
[src]

fn cast_to(self, interner: &U::Interner) -> Option<U>[src]

impl<T, U, E> CastTo<Result<U, E>> for Result<T, E> where
    T: CastTo<U>,
    U: HasInterner
[src]

fn cast_to(self, interner: &U::Interner) -> Result<U, E>[src]

impl<T, U> CastTo<Vec<U, Global>> for Vec<T> where
    T: CastTo<U> + HasInterner,
    U: HasInterner
[src]

fn cast_to(self, interner: &U::Interner) -> Vec<U>[src]

impl<T> CastTo<T> for &T where
    T: Clone + HasInterner
[src]

fn cast_to(self, _interner: &T::Interner) -> T[src]

Implementors

impl<I, T> CastTo<ProgramClause<I>> for Binders<T> where
    I: Interner,
    T: HasInterner<Interner = I> + CastTo<DomainGoal<I>>, 
[src]

fn cast_to(self, interner: &I) -> ProgramClause<I>[src]

impl<I: Interner> CastTo<Constraint<I>> for Constraint<I>[src]

fn cast_to(
    self,
    _interner: &<Constraint<I> as HasInterner>::Interner
) -> Constraint<I>
[src]

impl<I: Interner> CastTo<DomainGoal<I>> for DomainGoal<I>[src]

fn cast_to(
    self,
    _interner: &<DomainGoal<I> as HasInterner>::Interner
) -> DomainGoal<I>
[src]

impl<I: Interner> CastTo<DomainGoal<I>> for FromEnv<I>[src]

fn cast_to(self, _interner: &I) -> DomainGoal<I>[src]

impl<I: Interner> CastTo<DomainGoal<I>> for WellFormed<I>[src]

fn cast_to(self, _interner: &I) -> DomainGoal<I>[src]

impl<I: Interner> CastTo<DomainGoal<I>> for Normalize<I>[src]

fn cast_to(self, _interner: &I) -> DomainGoal<I>[src]

impl<I: Interner> CastTo<LifetimeData<I>> for LifetimeData<I>[src]

fn cast_to(
    self,
    _interner: &<LifetimeData<I> as HasInterner>::Interner
) -> LifetimeData<I>
[src]

impl<I: Interner> CastTo<TyKind<I>> for AliasTy<I>[src]

fn cast_to(self, _interner: &I) -> TyKind<I>[src]

impl<I: Interner> CastTo<TyKind<I>> for TyKind<I>[src]

fn cast_to(self, _interner: &<TyKind<I> as HasInterner>::Interner) -> TyKind<I>[src]

impl<I: Interner> CastTo<VariableKind<I>> for VariableKind<I>[src]

fn cast_to(
    self,
    _interner: &<VariableKind<I> as HasInterner>::Interner
) -> VariableKind<I>
[src]

impl<I: Interner> CastTo<WhereClause<I>> for WhereClause<I>[src]

fn cast_to(
    self,
    _interner: &<WhereClause<I> as HasInterner>::Interner
) -> WhereClause<I>
[src]

impl<I: Interner> CastTo<WhereClause<I>> for AliasEq<I>[src]

fn cast_to(self, _interner: &I) -> WhereClause<I>[src]

impl<I: Interner> CastTo<WhereClause<I>> for LifetimeOutlives<I>[src]

fn cast_to(self, _interner: &I) -> WhereClause<I>[src]

impl<I: Interner> CastTo<WhereClause<I>> for TraitRef<I>[src]

fn cast_to(self, _interner: &I) -> WhereClause<I>[src]

impl<I: Interner> CastTo<WhereClause<I>> for TypeOutlives<I>[src]

fn cast_to(self, _interner: &I) -> WhereClause<I>[src]

impl<I: Interner> CastTo<Binders<WhereClause<I>>> for QuantifiedWhereClause<I>[src]

fn cast_to(
    self,
    _interner: &<QuantifiedWhereClause<I> as HasInterner>::Interner
) -> QuantifiedWhereClause<I>
[src]

impl<I: Interner> CastTo<CanonicalVarKinds<I>> for CanonicalVarKinds<I>[src]

fn cast_to(
    self,
    _interner: &<CanonicalVarKinds<I> as HasInterner>::Interner
) -> CanonicalVarKinds<I>
[src]

impl<I: Interner> CastTo<ConstData<I>> for ConstData<I>[src]

fn cast_to(
    self,
    _interner: &<ConstData<I> as HasInterner>::Interner
) -> ConstData<I>
[src]

impl<I: Interner> CastTo<GenericArg<I>> for Const<I>[src]

fn cast_to(self, interner: &I) -> GenericArg<I>[src]

impl<I: Interner> CastTo<GenericArg<I>> for GenericArg<I>[src]

fn cast_to(self, _interner: &I) -> GenericArg<I>[src]

impl<I: Interner> CastTo<GenericArg<I>> for Lifetime<I>[src]

fn cast_to(self, interner: &I) -> GenericArg<I>[src]

impl<I: Interner> CastTo<GenericArg<I>> for Ty<I>[src]

fn cast_to(self, interner: &I) -> GenericArg<I>[src]

impl<I: Interner> CastTo<Goal<I>> for EqGoal<I>[src]

fn cast_to(self, interner: &I) -> Goal<I>[src]

impl<I: Interner> CastTo<Goal<I>> for Goal<I>[src]

fn cast_to(self, _interner: &<Goal<I> as HasInterner>::Interner) -> Goal<I>[src]

impl<I: Interner> CastTo<Goal<I>> for SubtypeGoal<I>[src]

fn cast_to(self, interner: &I) -> Goal<I>[src]

impl<I: Interner> CastTo<ProgramClause<I>> for ProgramClause<I>[src]

fn cast_to(
    self,
    _interner: &<ProgramClause<I> as HasInterner>::Interner
) -> ProgramClause<I>
[src]

impl<I: Interner> CastTo<TraitRef<I>> for TraitRef<I>[src]

fn cast_to(
    self,
    _interner: &<TraitRef<I> as HasInterner>::Interner
) -> TraitRef<I>
[src]

impl<I: Interner> CastTo<VariableKinds<I>> for VariableKinds<I>[src]

fn cast_to(
    self,
    _interner: &<VariableKinds<I> as HasInterner>::Interner
) -> VariableKinds<I>
[src]

impl<I: Interner> CastTo<WithKind<I, UniverseIndex>> for CanonicalVarKind<I>[src]

fn cast_to(
    self,
    _interner: &<CanonicalVarKind<I> as HasInterner>::Interner
) -> CanonicalVarKind<I>
[src]

impl<I: Interner, T: HasInterner<Interner = I> + CastTo<Goal<I>>> CastTo<Goal<I>> for Binders<T>[src]

fn cast_to(self, interner: &I) -> Goal<I>[src]

impl<T, I> CastTo<DomainGoal<I>> for T where
    T: CastTo<WhereClause<I>>,
    I: Interner
[src]

fn cast_to(self, interner: &I) -> DomainGoal<I>[src]

impl<T, I> CastTo<ProgramClause<I>> for T where
    T: CastTo<DomainGoal<I>>,
    I: Interner
[src]

fn cast_to(self, interner: &I) -> ProgramClause<I>[src]

impl<T, I: Interner> CastTo<Goal<I>> for T where
    T: CastTo<DomainGoal<I>>, 
[src]

fn cast_to(self, interner: &I) -> Goal<I>[src]

impl<T, U> CastTo<Canonical<U>> for Canonical<T> where
    T: CastTo<U> + HasInterner,
    U: HasInterner<Interner = T::Interner>, 
[src]

fn cast_to(self, interner: &T::Interner) -> Canonical<U>[src]

impl<T, U, I> CastTo<InEnvironment<U>> for InEnvironment<T> where
    T: HasInterner<Interner = I> + CastTo<U>,
    U: HasInterner<Interner = I>,
    I: Interner
[src]

fn cast_to(self, interner: &U::Interner) -> InEnvironment<U>[src]