pub enum Wikinode {
Show 19 variants
BehaviorSwitch(BehaviorSwitch),
Category(Category),
Comment(Comment),
DisplaySpace(DisplaySpace),
ExtLink(ExtLink),
Gallery(Gallery),
Heading(Heading),
HtmlEntity(HtmlEntity),
Image(Image),
IncludeOnly(IncludeOnly),
Indicator(Indicator),
InterwikiLink(InterwikiLink),
LanguageLink(LanguageLink),
Nowiki(Nowiki),
Placeholder(Placeholder),
Redirect(Redirect),
Section(Section),
WikiLink(WikiLink),
Generic(Wikicode),
}
Expand description
Enum that represents all the different types of nodes
Variants§
BehaviorSwitch(BehaviorSwitch)
Category(Category)
Comment(Comment)
HTML comment
DisplaySpace(DisplaySpace)
ExtLink(ExtLink)
External link
Gallery(Gallery)
Heading(Heading)
HtmlEntity(HtmlEntity)
Image(Image)
IncludeOnly(IncludeOnly)
Indicator(Indicator)
InterwikiLink(InterwikiLink)
LanguageLink(LanguageLink)
Nowiki(Nowiki)
Placeholder(Placeholder)
Redirect(Redirect)
Section(Section)
WikiLink(WikiLink)
Wiki (internal) link
Generic(Wikicode)
A generic HTML node that we haven’t implemented a specific type for yet or doesn’t need one.
Implementations§
source§impl Wikinode
impl Wikinode
pub fn as_behavior_switch(&self) -> Option<BehaviorSwitch>
pub fn as_category(&self) -> Option<Category>
sourcepub fn as_comment(&self) -> Option<Comment>
pub fn as_comment(&self) -> Option<Comment>
If this node is a comment, get a clone of it
pub fn as_displayspace(&self) -> Option<DisplaySpace>
sourcepub fn as_extlink(&self) -> Option<ExtLink>
pub fn as_extlink(&self) -> Option<ExtLink>
If this node is an external link, get a clone of it
sourcepub fn as_gallery(&self) -> Option<Gallery>
pub fn as_gallery(&self) -> Option<Gallery>
If this node is a gallery, get a clone of it
sourcepub fn as_generic(&self) -> Option<Wikicode>
pub fn as_generic(&self) -> Option<Wikicode>
If this node is generic, get a clone of it
pub fn as_heading(&self) -> Option<Heading>
pub fn as_html_entity(&self) -> Option<HtmlEntity>
pub fn as_image(&self) -> Option<Image>
pub fn as_includeonly(&self) -> Option<IncludeOnly>
pub fn as_indicator(&self) -> Option<Indicator>
pub fn as_interwiki_link(&self) -> Option<InterwikiLink>
pub fn as_language_link(&self) -> Option<LanguageLink>
pub fn as_nowiki(&self) -> Option<Nowiki>
pub fn as_placeholder(&self) -> Option<Placeholder>
pub fn as_redirect(&self) -> Option<Redirect>
pub fn as_section(&self) -> Option<Section>
sourcepub fn as_wikilink(&self) -> Option<WikiLink>
pub fn as_wikilink(&self) -> Option<WikiLink>
If this node is a wiki link, get a clone of it
Methods from Deref<Target = NodeRef>§
sourcepub fn inclusive_ancestors(&self) -> Ancestors
pub fn inclusive_ancestors(&self) -> Ancestors
Return an iterator of references to this node and its ancestors.
sourcepub fn ancestors(&self) -> Ancestors
pub fn ancestors(&self) -> Ancestors
Return an iterator of references to this node’s ancestors.
sourcepub fn inclusive_preceding_siblings(&self) -> Rev<Siblings>
pub fn inclusive_preceding_siblings(&self) -> Rev<Siblings>
Return an iterator of references to this node and the siblings before it.
sourcepub fn preceding_siblings(&self) -> Rev<Siblings>
pub fn preceding_siblings(&self) -> Rev<Siblings>
Return an iterator of references to this node’s siblings before it.
sourcepub fn inclusive_following_siblings(&self) -> Siblings
pub fn inclusive_following_siblings(&self) -> Siblings
Return an iterator of references to this node and the siblings after it.
sourcepub fn following_siblings(&self) -> Siblings
pub fn following_siblings(&self) -> Siblings
Return an iterator of references to this node’s siblings after it.
sourcepub fn inclusive_descendants(&self) -> Descendants
pub fn inclusive_descendants(&self) -> Descendants
Return an iterator of references to this node and its descendants, in tree order.
Parent nodes appear before the descendants.
Note: this is the NodeEdge::Start
items from traverse()
.
sourcepub fn descendants(&self) -> Descendants
pub fn descendants(&self) -> Descendants
Return an iterator of references to this node’s descendants, in tree order.
Parent nodes appear before the descendants.
Note: this is the NodeEdge::Start
items from traverse()
.
sourcepub fn traverse_inclusive(&self) -> Traverse
pub fn traverse_inclusive(&self) -> Traverse
Return an iterator of the start and end edges of this node and its descendants, in tree order.
sourcepub fn traverse(&self) -> Traverse
pub fn traverse(&self) -> Traverse
Return an iterator of the start and end edges of this node’s descendants, in tree order.
sourcepub fn select(
&self,
selectors: &str
) -> Result<Select<Elements<Descendants>, Selectors>, ()>
pub fn select(
&self,
selectors: &str
) -> Result<Select<Elements<Descendants>, Selectors>, ()>
Return an iterator of the inclusive descendants element that match the given selector list.
sourcepub fn select_first(
&self,
selectors: &str
) -> Result<NodeDataRef<ElementData>, ()>
pub fn select_first(
&self,
selectors: &str
) -> Result<NodeDataRef<ElementData>, ()>
Return the first inclusive descendants element that match the given selector list.
sourcepub fn text_contents(&self) -> String
pub fn text_contents(&self) -> String
Return the concatenation of all text nodes in this subtree.
sourcepub fn append(&self, new_child: NodeRef)
pub fn append(&self, new_child: NodeRef)
Append a new child to this node, after existing children.
The new child is detached from its previous position.
sourcepub fn prepend(&self, new_child: NodeRef)
pub fn prepend(&self, new_child: NodeRef)
Prepend a new child to this node, before existing children.
The new child is detached from its previous position.
sourcepub fn insert_after(&self, new_sibling: NodeRef)
pub fn insert_after(&self, new_sibling: NodeRef)
Insert a new sibling after this node.
The new sibling is detached from its previous position.
sourcepub fn insert_before(&self, new_sibling: NodeRef)
pub fn insert_before(&self, new_sibling: NodeRef)
Insert a new sibling before this node.
The new sibling is detached from its previous position.
Methods from Deref<Target = Node>§
sourcepub fn as_element(&self) -> Option<&ElementData>
pub fn as_element(&self) -> Option<&ElementData>
If this node is an element, return a reference to element-specific data.
sourcepub fn as_text(&self) -> Option<&RefCell<String>>
pub fn as_text(&self) -> Option<&RefCell<String>>
If this node is a text node, return a reference to its contents.
sourcepub fn as_comment(&self) -> Option<&RefCell<String>>
pub fn as_comment(&self) -> Option<&RefCell<String>>
If this node is a comment, return a reference to its contents.
sourcepub fn as_doctype(&self) -> Option<&Doctype>
pub fn as_doctype(&self) -> Option<&Doctype>
If this node is a document, return a reference to doctype-specific data.
sourcepub fn as_document(&self) -> Option<&DocumentData>
pub fn as_document(&self) -> Option<&DocumentData>
If this node is a document, return a reference to document-specific data.
sourcepub fn parent(&self) -> Option<NodeRef>
pub fn parent(&self) -> Option<NodeRef>
Return a reference to the parent node, unless this node is the root of the tree.
sourcepub fn first_child(&self) -> Option<NodeRef>
pub fn first_child(&self) -> Option<NodeRef>
Return a reference to the first child of this node, unless it has no child.
sourcepub fn last_child(&self) -> Option<NodeRef>
pub fn last_child(&self) -> Option<NodeRef>
Return a reference to the last child of this node, unless it has no child.
sourcepub fn previous_sibling(&self) -> Option<NodeRef>
pub fn previous_sibling(&self) -> Option<NodeRef>
Return a reference to the previous sibling of this node, unless it is a first child.
sourcepub fn next_sibling(&self) -> Option<NodeRef>
pub fn next_sibling(&self) -> Option<NodeRef>
Return a reference to the next sibling of this node, unless it is a last child.
Trait Implementations§
source§impl From<BehaviorSwitch> for Wikinode
impl From<BehaviorSwitch> for Wikinode
source§fn from(node: BehaviorSwitch) -> Self
fn from(node: BehaviorSwitch) -> Self
source§impl From<DisplaySpace> for Wikinode
impl From<DisplaySpace> for Wikinode
source§fn from(node: DisplaySpace) -> Self
fn from(node: DisplaySpace) -> Self
source§impl From<HtmlEntity> for Wikinode
impl From<HtmlEntity> for Wikinode
source§fn from(node: HtmlEntity) -> Self
fn from(node: HtmlEntity) -> Self
source§impl From<IncludeOnly> for Wikinode
impl From<IncludeOnly> for Wikinode
source§fn from(node: IncludeOnly) -> Self
fn from(node: IncludeOnly) -> Self
source§impl From<InterwikiLink> for Wikinode
impl From<InterwikiLink> for Wikinode
source§fn from(node: InterwikiLink) -> Self
fn from(node: InterwikiLink) -> Self
source§impl From<LanguageLink> for Wikinode
impl From<LanguageLink> for Wikinode
source§fn from(node: LanguageLink) -> Self
fn from(node: LanguageLink) -> Self
source§impl From<Placeholder> for Wikinode
impl From<Placeholder> for Wikinode
source§fn from(node: Placeholder) -> Self
fn from(node: Placeholder) -> Self
source§impl WikinodeIterator for Wikinode
impl WikinodeIterator for Wikinode
fn as_node(&self) -> &NodeRef
source§fn append<N: WikiMultinode>(&self, code: &N)
fn append<N: WikiMultinode>(&self, code: &N)
source§fn prepend<N: WikiMultinode>(&self, code: &N)
fn prepend<N: WikiMultinode>(&self, code: &N)
source§fn insert_after<N: WikiMultinode>(&self, code: &N)
fn insert_after<N: WikiMultinode>(&self, code: &N)
source§fn insert_before<N: WikiMultinode>(&self, code: &N)
fn insert_before<N: WikiMultinode>(&self, code: &N)
source§fn select_first(&self, selector: &str) -> Option<Wikinode>
fn select_first(&self, selector: &str) -> Option<Wikinode>
source§fn filter_links(&self) -> Vec<WikiLink>
fn filter_links(&self) -> Vec<WikiLink>
[[Foo|bar]]
)source§fn filter_external_links(&self) -> Vec<ExtLink>
fn filter_external_links(&self) -> Vec<ExtLink>
[https://example.org/ Example]
)source§fn filter_categories(&self) -> Vec<Category>
fn filter_categories(&self) -> Vec<Category>
source§fn filter_comments(&self) -> Vec<Comment>
fn filter_comments(&self) -> Vec<Comment>
<!-- example -->
)