5 use rustc_hir::def_id::DefId;
7 crate use renderer::{run_format, FormatRenderer};
11 /// Specifies whether rendering directly implemented trait items or ones from a certain Deref
13 crate enum AssocItemRender<'a> {
15 DerefFor { trait_: &'a clean::Path, type_: &'a clean::Type, deref_mut_: bool },
18 /// For different handling of associated items from the Deref target of a type rather than the type
20 #[derive(Copy, Clone, PartialEq)]
21 crate enum RenderMode {
23 ForDeref { mut_: bool },
26 /// Metadata about implementations for a type or trait.
27 #[derive(Clone, Debug)]
29 crate impl_item: clean::Item,
33 crate fn inner_impl(&self) -> &clean::Impl {
34 match *self.impl_item.kind {
35 clean::ImplItem(ref impl_) => impl_,
36 _ => panic!("non-impl item found in impl"),
40 crate fn trait_did(&self) -> Option<DefId> {
41 self.inner_impl().trait_.as_ref().map(|t| t.def_id())