5 crate use renderer::{run_format, FormatRenderer};
7 use rustc_span::def_id::DefId;
10 use crate::clean::types::GetDefId;
12 /// Specifies whether rendering directly implemented trait items or ones from a certain Deref
14 crate enum AssocItemRender<'a> {
16 DerefFor { trait_: &'a clean::Type, type_: &'a clean::Type, deref_mut_: bool },
19 /// For different handling of associated items from the Deref target of a type rather than the type
21 #[derive(Copy, Clone, PartialEq)]
22 crate enum RenderMode {
24 ForDeref { mut_: bool },
27 /// Metadata about implementations for a type or trait.
28 #[derive(Clone, Debug)]
30 crate impl_item: clean::Item,
34 crate fn inner_impl(&self) -> &clean::Impl {
35 match *self.impl_item.kind {
36 clean::ImplItem(ref impl_) => impl_,
37 _ => panic!("non-impl item found in impl"),
41 crate fn trait_did(&self) -> Option<DefId> {
42 self.inner_impl().trait_.def_id()