Function rustc_typeck::metadata::csearch::get_trait_of_itemUnstable [-] [+] [src]

pub fn get_trait_of_item(cstore: &CStore, def_id: DefId, tcx: &ctxt) -> Option<DefId>

If the given def ID describes an item belonging to a trait (either a default method or an implementation of a trait method), returns the ID of the trait that the method belongs to. Otherwise, returns None.