[][src]Struct chalk_rust_ir::TraitDatum

pub struct TraitDatum<I: Interner> {
    pub id: TraitId<I>,
    pub binders: Binders<TraitDatumBound<I>>,
    pub flags: TraitFlags,
    pub associated_ty_ids: Vec<AssocTypeId<I>>,
    pub well_known: Option<WellKnownTrait>,
}

A rust intermediate representation (rust_ir) of a Trait Definition. For example, given the following rust code:

This example deliberately fails to compile
use std::fmt::Debug;

trait Foo<T>
where
    T: Debug,
{
    type Bar<U>;
}

This would represent the trait Foo declaration. Note that the details of the trait members (e.g., the associated type declaration (type Bar<U>) are not contained in this type, and are represented separately (e.g., in AssociatedTyDatum).

Not to be confused with the rust_ir for a Trait Implementation, which is represented by ImplDatum

Fields

id: TraitId<I>binders: Binders<TraitDatumBound<I>>flags: TraitFlags

"Flags" indicate special kinds of traits, like auto traits. In Rust syntax these are represented in different ways, but in chalk we add annotations like #[auto].

associated_ty_ids: Vec<AssocTypeId<I>>well_known: Option<WellKnownTrait>

If this is a well-known trait, which one? If None, this is a regular, user-defined trait.

Methods

impl<I: Interner> TraitDatum<I>[src]

Trait Implementations

impl<I: Clone + Interner> Clone for TraitDatum<I>[src]

impl<I: Debug + Interner> Debug for TraitDatum<I>[src]

impl<I: Eq + Interner> Eq for TraitDatum<I>[src]

impl<I: Hash + Interner> Hash for TraitDatum<I>[src]

impl<I: PartialEq + Interner> PartialEq<TraitDatum<I>> for TraitDatum<I>[src]

impl<I: Interner> StructuralEq for TraitDatum<I>[src]

impl<I: Interner> StructuralPartialEq for TraitDatum<I>[src]

Auto Trait Implementations

impl<I> RefUnwindSafe for TraitDatum<I> where
    <I as Interner>::DefId: RefUnwindSafe,
    <I as Interner>::InternedParameterKinds: RefUnwindSafe,
    <I as Interner>::InternedSubstitution: RefUnwindSafe,
    <I as Interner>::InternedType: RefUnwindSafe

impl<I> Send for TraitDatum<I> where
    <I as Interner>::DefId: Send,
    <I as Interner>::InternedParameterKinds: Send,
    <I as Interner>::InternedSubstitution: Send,
    <I as Interner>::InternedType: Send

impl<I> Sync for TraitDatum<I> where
    <I as Interner>::DefId: Sync,
    <I as Interner>::InternedParameterKinds: Sync,
    <I as Interner>::InternedSubstitution: Sync,
    <I as Interner>::InternedType: Sync

impl<I> Unpin for TraitDatum<I> where
    <I as Interner>::DefId: Unpin,
    <I as Interner>::InternedParameterKinds: Unpin,
    <I as Interner>::InternedSubstitution: Unpin,
    <I as Interner>::InternedType: Unpin

impl<I> UnwindSafe for TraitDatum<I> where
    <I as Interner>::DefId: UnwindSafe,
    <I as Interner>::InternedParameterKinds: UnwindSafe,
    <I as Interner>::InternedSubstitution: UnwindSafe,
    <I as Interner>::InternedType: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Cast for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.