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