pub trait TyExt<'tcx> {
// Required methods
fn inner_regions(self) -> impl Iterator<Item = Region<'tcx>>;
fn does_implement_trait(
self,
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>,
trait_def_id: DefId,
) -> bool;
fn is_copyable(self, tcx: TyCtxt<'tcx>, typing_env: TypingEnv<'tcx>) -> bool;
}
Expand description
Extension trait for Ty
.
Required Methods§
Sourcefn inner_regions(self) -> impl Iterator<Item = Region<'tcx>>
fn inner_regions(self) -> impl Iterator<Item = Region<'tcx>>
Returns an iterator over the regions appearing within a type.
Sourcefn does_implement_trait(
self,
tcx: TyCtxt<'tcx>,
param_env: ParamEnv<'tcx>,
trait_def_id: DefId,
) -> bool
fn does_implement_trait( self, tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>, trait_def_id: DefId, ) -> bool
Returns true if a type implements a given trait.
Sourcefn is_copyable(self, tcx: TyCtxt<'tcx>, typing_env: TypingEnv<'tcx>) -> bool
fn is_copyable(self, tcx: TyCtxt<'tcx>, typing_env: TypingEnv<'tcx>) -> bool
Returns true if a type implements Copy
.
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.