parsoid::prelude

Trait 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§

Source

fn as_node(&self) -> &NodeRef

Provided Methods§

Source

fn append<N: WikiMultinode>(&self, code: &N)

Append a node as a child

Source

fn prepend<N: WikiMultinode>(&self, code: &N)

Prepend a node as a child

Source

fn insert_after<N: WikiMultinode>(&self, code: &N)

Insert a node after the current node, as a sibling

Source

fn insert_before<N: WikiMultinode>(&self, code: &N)

Insert a node before the current node, as a sibling

Source

fn select(&self, selector: &str) -> Vec<Wikinode>

Select some wiki nodes

Source

fn select_first(&self, selector: &str) -> Option<Wikinode>

Get the first element that matches the selector, if possible

Get a list of all wikilinks ([[Foo|bar]])

Get a list of all external links ([https://example.org/ Example])

Source

fn filter_categories(&self) -> Vec<Category>

Get a list of all categories

Source

fn filter_comments(&self) -> Vec<Comment>

Get a list of all comments (<!-- example -->)

Source

fn filter_images(&self) -> Vec<Image>

Get a list of all iamges

Source

fn filter_templates(&self) -> Result<Vec<Template>>

Get a list of templates

Source

fn filter_parser_functions(&self) -> Result<Vec<Template>>

Get a list of parser functions.

Get a list of all reference links on the page, e.g. [1].

This includes both grouped and ungrouped references.

Source

fn filter_reference_lists(&self) -> Vec<ReferenceList>

Get a list of all reference lists on the page, e.g. <references>

Source

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.

Source

fn iter_sections(&self) -> Vec<Section>

Source

fn filter_noinclude(&self) -> Vec<NoInclude>

Source

fn filter_onlyinclude(&self) -> Vec<OnlyInclude>

Source

fn parent(&self) -> Option<Wikinode>

Return the parent node, if it has one

Source

fn next_sibling(&self) -> Option<Wikinode>

Return the next sibling node, if it has one

Source

fn previous_sibling(&self) -> Option<Wikinode>

Return the previous sibling node, if it has one

Source

fn inclusive_ancestors(&self) -> WikinodeMap<Ancestors>

Return an iterator of references to this node and its ancestors.

Source

fn ancestors(&self) -> WikinodeMap<Ancestors>

Return an iterator of references to this node’s ancestors.

Source

fn inclusive_preceding_siblings(&self) -> WikinodeMap<Rev<Siblings>>

Return an iterator of references to this node and the siblings before it.

Source

fn preceding_siblings(&self) -> WikinodeMap<Rev<Siblings>>

Return an iterator of references to this node’s siblings before it.

Source

fn inclusive_following_siblings(&self) -> WikinodeMap<Siblings>

Return an iterator of references to this node and the siblings after it.

Source

fn following_siblings(&self) -> WikinodeMap<Siblings>

Return an iterator of references to this node’s siblings after it.

Source

fn children(&self) -> WikinodeMap<Siblings>

Return an iterator of references to this node’s children.

Source

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.

Source

fn descendants(&self) -> WikinodeMap<Descendants>

Return an iterator of references to this node’s descendants, in tree order. Parent nodes appear before the descendants.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§