Function rustc_trans::middle::ty::trait_of_itemUnstable [-] [+] [src]

pub fn trait_of_item(tcx: &ctxt, def_id: DefId) -> 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), return the ID of the trait that the method belongs to. Otherwise, return None.