Function rustdoc::clean::inline::try_inline

source ·
pub(crate) fn try_inline(
    cx: &mut DocContext<'_>,
    parent_module: DefId,
    import_def_id: Option<DefId>,
    res: Res,
    name: Symbol,
    attrs: Option<&[Attribute]>,
    visited: &mut FxHashSet<DefId>
) -> Option<Vec<Item>>
Expand description

Attempt to inline a definition into this AST.

This function will fetch the definition specified, and if it is from another crate it will attempt to inline the documentation from the other crate into this crate.

This is primarily used for pub use statements which are, in general, implementation details. Inlining the documentation should help provide a better experience when reading the documentation in this use case.

The returned value is None if the definition could not be inlined, and Some of a vector of items if it was successfully expanded.

parent_module refers to the parent of the re-export, not the original item.