pub fn trait_of_item(self, def_id: DefId) -> Option<DefId> {
        if def_id.krate != LOCAL_CRATE {
            return self.sess.cstore.trait_of_item(def_id);
        }
        match self.associated_items.borrow().get(&def_id) {
            Some(associated_item) => {
                match associated_item.container {
                    TraitContainer(def_id) => Some(def_id),
                    ImplContainer(_) => None
                }
            }
            None => None
        }
    }
/// If the given def ID describes an item belonging to a trait,
/// return the ID of the trait that the trait item belongs to.
/// Otherwise, return `None`.
If the given def ID describes an item belonging to a trait,
return the ID of the trait that the trait item belongs to.
Otherwise, return `None`.
If the given def ID describes an item belonging to a trait return the ID of the trait that the trait item belongs to . Otherwise return ` None ` .
pub fn trait_of_item(self, def_id: DefId) -> Option<DefId> {
        if def_id.krate != LOCAL_CRATE {
            return self.sess.cstore.trait_of_item(def_id);
        }
        match self.associated_items.borrow().get(&def_id) {
            Some(associated_item) => {
                match associated_item.container {
                    TraitContainer(def_id) => Some(def_id),
                    ImplContainer(_) => None
                }
            }
            None => None
        }
    }
pub fn trait_of_item ( self , def_id : DefId ) -> Option < DefId > { if def_id . krate != LOCAL_CRATE { return self . sess . cstore . trait_of_item ( def_id ) ; } match self . associated_items . borrow ( ) . get ( & def_id ) { Some ( associated_item ) => { match associated_item . container { TraitContainer ( def_id ) => Some ( def_id ) , ImplContainer ( _ ) => None } } None => None } }
If the given def ID describes an item belonging to a trait,
return the ID of the trait that the trait item belongs to.
If the given def ID describes an item belonging to a trait return the ID of the trait that the trait item belongs to .
self
def_id
DefId