Skip to main content

for_each_annotation

Function for_each_annotation 

Source
pub fn for_each_annotation<F>(document: &Document, f: &mut F)
where F: FnMut(&Annotation),
Expand description

Visits every annotation in the document, invoking the callback for each.

Traverses the full document tree to find annotations at all levels: document-level, session-level, and nested within content items like paragraphs, lists, definitions, and verbatim blocks. Annotations are visited in document order (top to bottom).

Use this for annotation-related features like navigation, resolution toggling, or collecting annotation labels for completion.