pub trait AdtDef<I: Interner>:
Copy
+ Debug
+ Hash
+ Eq {
// Required methods
fn def_id(self) -> I::DefId;
fn is_struct(self) -> bool;
fn struct_tail_ty(self, interner: I) -> Option<EarlyBinder<I, I::Ty>>;
fn is_phantom_data(self) -> bool;
fn all_field_tys(
self,
interner: I,
) -> EarlyBinder<I, impl IntoIterator<Item = I::Ty>>;
fn sized_constraint(self, interner: I) -> Option<EarlyBinder<I, I::Ty>>;
fn is_fundamental(self) -> bool;
fn destructor(self, interner: I) -> Option<AdtDestructorKind>;
}
Required Methods§
fn def_id(self) -> I::DefId
fn is_struct(self) -> bool
Sourcefn struct_tail_ty(self, interner: I) -> Option<EarlyBinder<I, I::Ty>>
fn struct_tail_ty(self, interner: I) -> Option<EarlyBinder<I, I::Ty>>
Returns the type of the struct tail.
Expects the AdtDef
to be a struct. If it is not, then this will panic.
fn is_phantom_data(self) -> bool
fn all_field_tys( self, interner: I, ) -> EarlyBinder<I, impl IntoIterator<Item = I::Ty>>
fn sized_constraint(self, interner: I) -> Option<EarlyBinder<I, I::Ty>>
fn is_fundamental(self) -> bool
fn destructor(self, interner: I) -> Option<AdtDestructorKind>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.