AssocItemTag

Trait AssocItemTag 

Source
trait AssocItemTag: Copy {
    type AssocItem<'tcx>;

    // Required methods
    fn descr(self) -> &'static str;
    fn trait_defines_item_named<'tcx>(
        self,
        genv: GlobalEnv<'_, 'tcx>,
        trait_def_id: DefId,
        assoc_name: Ident,
    ) -> QueryResult<Option<Self::AssocItem<'tcx>>>;
    fn transitive_bounds_that_define_assoc_item<'tcx>(
        self,
        genv: GlobalEnv<'_, 'tcx>,
        trait_refs: impl Iterator<Item = PolyTraitRef<'tcx>>,
        assoc_name: Ident,
    ) -> impl Iterator<Item = PolyTraitRef<'tcx>>;
}
Expand description

This trait is used to define functions generically over both associated refinements and associated items (types, consts, and functions).

Required Associated Types§

Source

type AssocItem<'tcx>

Required Methods§

Source

fn descr(self) -> &'static str

Source

fn trait_defines_item_named<'tcx>( self, genv: GlobalEnv<'_, 'tcx>, trait_def_id: DefId, assoc_name: Ident, ) -> QueryResult<Option<Self::AssocItem<'tcx>>>

Source

fn transitive_bounds_that_define_assoc_item<'tcx>( self, genv: GlobalEnv<'_, 'tcx>, trait_refs: impl Iterator<Item = PolyTraitRef<'tcx>>, assoc_name: Ident, ) -> impl Iterator<Item = PolyTraitRef<'tcx>>

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.

Implementations on Foreign Types§

Source§

impl AssocItemTag for AssocTag

Source§

type AssocItem<'tcx> = &'tcx AssocItem

Source§

fn descr(self) -> &'static str

Source§

fn trait_defines_item_named<'tcx>( self, genv: GlobalEnv<'_, 'tcx>, trait_def_id: DefId, assoc_name: Ident, ) -> QueryResult<Option<Self::AssocItem<'tcx>>>

Source§

fn transitive_bounds_that_define_assoc_item<'tcx>( self, genv: GlobalEnv<'_, 'tcx>, trait_refs: impl Iterator<Item = PolyTraitRef<'tcx>>, assoc_name: Ident, ) -> impl Iterator<Item = PolyTraitRef<'tcx>>

Implementors§