pub struct DocBinding {
pub kept: KeptDocs,
pub skips: for<'a, 'b> fn(&Node<'a>, Ancestors<'a, 'b>) -> bool,
pub forward: for<'a, 'b> fn(&Node<'a>, &[u8], Ancestors<'a, 'b>) -> bool,
pub gathers: Option<fn(&Node<'_>, &[u8]) -> bool>,
}Expand description
Re-exported because the LOC metric bills documentation through them —
Go, Ruby and Lua runs by position, and the doc comments a bound
language’s tool attaches — while the predicates beside them stay
crate-private.
Re-exported because the LOC metric bills documentation through them —
Go, Ruby and Lua runs by position, and the doc comments a bound
language’s tool attaches — while the predicates beside them stay
crate-private.
Re-exported because the LOC metric bills documentation through them —
Go, Ruby and Lua runs by position, and the doc comments a bound
language’s tool attaches — while the predicates beside them stay
crate-private.
How a language’s tool attaches a doc comment to the declaration after
it (#1613), read from each tool’s source rather than its manual
(lesson 98); see [Checker::DOC_BINDING]. A forward doc comment that
the binding does not attach documents nothing and is billed as a plain
comment.
The doc comments compared are those of one stretch: the comment
siblings between two other siblings, read past the ones
skips names. Blank rows never split a stretch; none of
the bound tools reads them.
Fields§
§kept: KeptDocsWhich doc comments of a stretch the tool attaches.
skips: for<'a, 'b> fn(&Node<'a>, Ancestors<'a, 'b>) -> boolA sibling that may sit between a doc comment and its target
without detaching it, so a stretch reads past it: rustc gives an
item every outer doc comment above it, through its other
attributes. A grammar that nests annotations inside the declaration
has nothing to skip. A skipped node is never a target. The
Ancestors are the node’s chain.
forward: for<'a, 'b> fn(&Node<'a>, &[u8], Ancestors<'a, 'b>) -> boolWhether a doc comment documents what follows it. false leaves it
to where it sits, as in an unbound language: Rust’s inner //!
documents the item enclosing it, a doc comment in a macro token
tree documents whatever the expansion makes of it, and a KDoc
inside a Kotlin declaration’s signature is read by findDocComment
from there. The Ancestors are the comment’s chain.
gathers: Option<fn(&Node<'_>, &[u8]) -> bool>A doc comment that documents an entry of its own and takes with it
the forward doc comments before it in its stretch, so they document
even when the stretch ends at no target: Doxygen gives a \file
block the doc blocks it has gathered since the last entry, so a
licence block above one at the end of a header documents the file.
It should not itself bind forward. Where the
stretch does end at a target, kept alone decides.
None for a tool with no such block, which lets a stretch that
ends at no target return before it is even collected.