# Trait rustc_infer::infer::canonical::ir::inherent::AdtDef

source ·

    pub trait AdtDef<I>: Copy + Debug + Hash + Eqwhere
        I: Interner,{
        // Required methods
        fn def_id(self) -> <I as Interner>::DefId;
        fn is_struct(self) -> bool;
        fn struct_tail_ty(
            self,
            interner: I,
        ) -> Option<EarlyBinder<I, <I as Interner>::Ty>>;
        fn is_phantom_data(self) -> bool;
        fn all_field_tys(
            self,
            interner: I,
        ) -> EarlyBinder<I, impl IntoIterator<Item = <I as Interner>::Ty>>;
        fn sized_constraint(
            self,
            interner: I,
        ) -> Option<EarlyBinder<I, <I as Interner>::Ty>>;
    }

## Required Methods§

source

#### fn def_id(self) -> <I as Interner>::DefId

source

#### fn is_struct(self) -> bool

source

#### fn struct_tail_ty( self, interner: I, ) -> Option<EarlyBinder<I, <I as Interner>::Ty>>

Returns the type of the struct tail.

Expects the `AdtDef` to be a struct. If it is not, then this will panic.

source

#### fn is_phantom_data(self) -> bool

source

#### fn all_field_tys( self, interner: I, ) -> EarlyBinder<I, impl IntoIterator<Item = <I as Interner>::Ty>>

source

#### fn sized_constraint( self, interner: I, ) -> Option<EarlyBinder<I, <I as Interner>::Ty>>

## Object Safety§

This trait is not object safe.

## Implementations on Foreign Types§

source§

### impl<'tcx> AdtDef<TyCtxt<'tcx>> for AdtDef<'tcx>

source§

#### fn def_id(self) -> DefId

source§

#### fn is_struct(self) -> bool

source§

#### fn struct_tail_ty( self, interner: TyCtxt<'tcx>, ) -> Option<EarlyBinder<TyCtxt<'tcx>, Ty<'tcx>>>

source§

#### fn is_phantom_data(self) -> bool

source§

#### fn all_field_tys( self, tcx: TyCtxt<'tcx>, ) -> EarlyBinder<TyCtxt<'tcx>, impl IntoIterator<Item = Ty<'tcx>>>

source§

#### fn sized_constraint( self, tcx: TyCtxt<'tcx>, ) -> Option<EarlyBinder<TyCtxt<'tcx>, Ty<'tcx>>>

## Implementors§