Trait parsoid::prelude::WikinodeIterator
source · pub trait WikinodeIterator: Sealed {
Show 32 methods
// Required method
fn as_node(&self) -> &NodeRef;
// Provided methods
fn append<N: WikiMultinode>(&self, code: &N) { ... }
fn prepend<N: WikiMultinode>(&self, code: &N) { ... }
fn insert_after<N: WikiMultinode>(&self, code: &N) { ... }
fn insert_before<N: WikiMultinode>(&self, code: &N) { ... }
fn select(&self, selector: &str) -> Vec<Wikinode> { ... }
fn select_first(&self, selector: &str) -> Option<Wikinode> { ... }
fn filter_links(&self) -> Vec<WikiLink> { ... }
fn filter_external_links(&self) -> Vec<ExtLink> { ... }
fn filter_categories(&self) -> Vec<Category> { ... }
fn filter_comments(&self) -> Vec<Comment> { ... }
fn filter_images(&self) -> Vec<Image> { ... }
fn filter_templates(&self) -> Result<Vec<Template>> { ... }
fn filter_parser_functions(&self) -> Result<Vec<Template>> { ... }
fn filter_reference_links(&self) -> Vec<ReferenceLink> { ... }
fn filter_reference_lists(&self) -> Vec<ReferenceList> { ... }
fn filter_references(&self) -> Vec<Reference> { ... }
fn iter_sections(&self) -> Vec<Section> { ... }
fn filter_noinclude(&self) -> Vec<NoInclude> { ... }
fn filter_onlyinclude(&self) -> Vec<OnlyInclude> { ... }
fn parent(&self) -> Option<Wikinode> { ... }
fn next_sibling(&self) -> Option<Wikinode> { ... }
fn previous_sibling(&self) -> Option<Wikinode> { ... }
fn inclusive_ancestors(&self) -> WikinodeMap<Ancestors> { ... }
fn ancestors(&self) -> WikinodeMap<Ancestors> { ... }
fn inclusive_preceding_siblings(&self) -> WikinodeMap<Rev<Siblings>> { ... }
fn preceding_siblings(&self) -> WikinodeMap<Rev<Siblings>> { ... }
fn inclusive_following_siblings(&self) -> WikinodeMap<Siblings> { ... }
fn following_siblings(&self) -> WikinodeMap<Siblings> { ... }
fn children(&self) -> WikinodeMap<Siblings> { ... }
fn inclusive_descendants(&self) -> WikinodeMap<Descendants> { ... }
fn descendants(&self) -> WikinodeMap<Descendants> { ... }
}
Expand description
Collection of iterators and mutators that allow operating on a tree of Wikinodes
Required Methods§
Provided Methods§
sourcefn append<N: WikiMultinode>(&self, code: &N)
fn append<N: WikiMultinode>(&self, code: &N)
Append a node as a child
sourcefn prepend<N: WikiMultinode>(&self, code: &N)
fn prepend<N: WikiMultinode>(&self, code: &N)
Prepend a node as a child
sourcefn insert_after<N: WikiMultinode>(&self, code: &N)
fn insert_after<N: WikiMultinode>(&self, code: &N)
Insert a node after the current node, as a sibling
sourcefn insert_before<N: WikiMultinode>(&self, code: &N)
fn insert_before<N: WikiMultinode>(&self, code: &N)
Insert a node before the current node, as a sibling
sourcefn select_first(&self, selector: &str) -> Option<Wikinode>
fn select_first(&self, selector: &str) -> Option<Wikinode>
Get the first element that matches the selector, if possible
sourcefn filter_links(&self) -> Vec<WikiLink>
fn filter_links(&self) -> Vec<WikiLink>
Get a list of all wikilinks ([[Foo|bar]]
)
sourcefn filter_external_links(&self) -> Vec<ExtLink>
fn filter_external_links(&self) -> Vec<ExtLink>
Get a list of all external links ([https://example.org/ Example]
)
sourcefn filter_categories(&self) -> Vec<Category>
fn filter_categories(&self) -> Vec<Category>
Get a list of all categories
sourcefn filter_comments(&self) -> Vec<Comment>
fn filter_comments(&self) -> Vec<Comment>
Get a list of all comments (<!-- example -->
)
sourcefn filter_images(&self) -> Vec<Image>
fn filter_images(&self) -> Vec<Image>
Get a list of all iamges
sourcefn filter_templates(&self) -> Result<Vec<Template>>
fn filter_templates(&self) -> Result<Vec<Template>>
Get a list of templates
sourcefn filter_parser_functions(&self) -> Result<Vec<Template>>
fn filter_parser_functions(&self) -> Result<Vec<Template>>
Get a list of parser functions.
sourcefn filter_reference_links(&self) -> Vec<ReferenceLink>
fn filter_reference_links(&self) -> Vec<ReferenceLink>
Get a list of all reference links on the page, e.g. [1]
.
This includes both grouped and ungrouped references.
sourcefn filter_reference_lists(&self) -> Vec<ReferenceList>
fn filter_reference_lists(&self) -> Vec<ReferenceList>
Get a list of all reference lists on the page, e.g. <references>
sourcefn filter_references(&self) -> Vec<Reference>
fn filter_references(&self) -> Vec<Reference>
Get all references on the page.
This contains grouped and ungrouped references, and are returned in the order they are presented in reference lists, so e.g. if the wikitext is:
<references group="foo"/>
<references/>
then the “foo” group references will be ordered first in the list, and then the ungrouped ones.
fn iter_sections(&self) -> Vec<Section>
fn filter_noinclude(&self) -> Vec<NoInclude>
fn filter_onlyinclude(&self) -> Vec<OnlyInclude>
sourcefn next_sibling(&self) -> Option<Wikinode>
fn next_sibling(&self) -> Option<Wikinode>
Return the next sibling node, if it has one
sourcefn previous_sibling(&self) -> Option<Wikinode>
fn previous_sibling(&self) -> Option<Wikinode>
Return the previous sibling node, if it has one
sourcefn inclusive_ancestors(&self) -> WikinodeMap<Ancestors>
fn inclusive_ancestors(&self) -> WikinodeMap<Ancestors>
Return an iterator of references to this node and its ancestors.
sourcefn ancestors(&self) -> WikinodeMap<Ancestors>
fn ancestors(&self) -> WikinodeMap<Ancestors>
Return an iterator of references to this node’s ancestors.
sourcefn inclusive_preceding_siblings(&self) -> WikinodeMap<Rev<Siblings>>
fn inclusive_preceding_siblings(&self) -> WikinodeMap<Rev<Siblings>>
Return an iterator of references to this node and the siblings before it.
sourcefn preceding_siblings(&self) -> WikinodeMap<Rev<Siblings>>
fn preceding_siblings(&self) -> WikinodeMap<Rev<Siblings>>
Return an iterator of references to this node’s siblings before it.
sourcefn inclusive_following_siblings(&self) -> WikinodeMap<Siblings>
fn inclusive_following_siblings(&self) -> WikinodeMap<Siblings>
Return an iterator of references to this node and the siblings after it.
sourcefn following_siblings(&self) -> WikinodeMap<Siblings>
fn following_siblings(&self) -> WikinodeMap<Siblings>
Return an iterator of references to this node’s siblings after it.
sourcefn children(&self) -> WikinodeMap<Siblings>
fn children(&self) -> WikinodeMap<Siblings>
Return an iterator of references to this node’s children.
sourcefn inclusive_descendants(&self) -> WikinodeMap<Descendants>
fn inclusive_descendants(&self) -> WikinodeMap<Descendants>
Return an iterator of references to this node and its descendants, in tree order. Parent nodes appear before the descendants.
sourcefn descendants(&self) -> WikinodeMap<Descendants>
fn descendants(&self) -> WikinodeMap<Descendants>
Return an iterator of references to this node’s descendants, in tree order. Parent nodes appear before the descendants.