Trait chalk_ir::cast::CastTo

source ·
pub trait CastTo<T: HasInterner>: Sized {
    // Required method
    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§

source

fn cast_to(self, interner: T::Interner) -> T

Cast a value to type T.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> CastTo<T> for &T
where T: Clone + HasInterner,

source§

fn cast_to(self, _interner: T::Interner) -> T

source§

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

source§

fn cast_to(self, interner: U::Interner) -> Option<U>

source§

impl<T, U> CastTo<Vec<U>> for Vec<T>
where T: CastTo<U> + HasInterner, U: HasInterner,

source§

fn cast_to(self, interner: U::Interner) -> Vec<U>

source§

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

source§

fn cast_to(self, interner: U::Interner) -> Result<U, E>

Implementors§

source§

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

source§

impl<I: Interner> CastTo<Constraint<I>> for Constraint<I>

source§

impl<I: Interner> CastTo<DomainGoal<I>> for DomainGoal<I>

source§

impl<I: Interner> CastTo<DomainGoal<I>> for FromEnv<I>

source§

impl<I: Interner> CastTo<DomainGoal<I>> for WellFormed<I>

source§

impl<I: Interner> CastTo<DomainGoal<I>> for Normalize<I>

source§

impl<I: Interner> CastTo<LifetimeData<I>> for LifetimeData<I>

source§

impl<I: Interner> CastTo<TyKind<I>> for AliasTy<I>

source§

impl<I: Interner> CastTo<TyKind<I>> for TyKind<I>

source§

impl<I: Interner> CastTo<VariableKind<I>> for VariableKind<I>

source§

impl<I: Interner> CastTo<WhereClause<I>> for WhereClause<I>

source§

impl<I: Interner> CastTo<WhereClause<I>> for AliasEq<I>

source§

impl<I: Interner> CastTo<WhereClause<I>> for LifetimeOutlives<I>

source§

impl<I: Interner> CastTo<WhereClause<I>> for TraitRef<I>

source§

impl<I: Interner> CastTo<WhereClause<I>> for TypeOutlives<I>

source§

impl<I: Interner> CastTo<Binders<WhereClause<I>>> for QuantifiedWhereClause<I>

source§

impl<I: Interner> CastTo<CanonicalVarKinds<I>> for CanonicalVarKinds<I>

source§

impl<I: Interner> CastTo<ConstData<I>> for ConstData<I>

source§

impl<I: Interner> CastTo<GenericArg<I>> for Const<I>

source§

impl<I: Interner> CastTo<GenericArg<I>> for GenericArg<I>

source§

impl<I: Interner> CastTo<GenericArg<I>> for Lifetime<I>

source§

impl<I: Interner> CastTo<GenericArg<I>> for Ty<I>

source§

impl<I: Interner> CastTo<Goal<I>> for EqGoal<I>

source§

impl<I: Interner> CastTo<Goal<I>> for Goal<I>

source§

impl<I: Interner> CastTo<Goal<I>> for SubtypeGoal<I>

source§

impl<I: Interner> CastTo<ProgramClause<I>> for ProgramClause<I>

source§

impl<I: Interner> CastTo<TraitRef<I>> for TraitRef<I>

source§

impl<I: Interner> CastTo<VariableKinds<I>> for VariableKinds<I>

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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