pub enum Wikinode {
Show 22 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),
Reference(Reference),
ReferenceLink(ReferenceLink),
ReferenceList(ReferenceList),
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)
Reference(Reference)
ReferenceLink(ReferenceLink)
ReferenceList(ReferenceList)
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_reference(&self) -> Option<Reference>
pub fn as_reference_link(&self) -> Option<ReferenceLink>
pub fn as_reference_list(&self) -> Option<ReferenceList>
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>§
pub fn inclusive_ancestors(&self) -> Ancestors
pub fn inclusive_ancestors(&self) -> Ancestors
Return an iterator of references to this node and its ancestors.
pub fn ancestors(&self) -> Ancestors
pub fn ancestors(&self) -> Ancestors
Return an iterator of references to this node’s ancestors.
pub 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.
pub 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.
pub 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.
pub fn following_siblings(&self) -> Siblings
pub fn following_siblings(&self) -> Siblings
Return an iterator of references to this node’s siblings after it.
pub fn children(&self) -> Siblings
pub fn children(&self) -> Siblings
Return an iterator of references to this node’s children.
pub 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()
.
pub 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()
.
pub 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.
pub 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.
pub fn select(
&self,
selectors: &str,
) -> Result<Select<Elements<Descendants>>, ()>
pub fn select( &self, selectors: &str, ) -> Result<Select<Elements<Descendants>>, ()>
Return an iterator of the inclusive descendants element that match the given selector list.
pub 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.
pub fn serialize<W>(&self, writer: &mut W) -> Result<(), Error>where
W: Write,
pub fn serialize<W>(&self, writer: &mut W) -> Result<(), Error>where
W: Write,
Serialize this node and its descendants in HTML syntax to the given stream.
pub fn serialize_to_file<P>(&self, path: P) -> Result<(), Error>
pub fn serialize_to_file<P>(&self, path: P) -> Result<(), Error>
Serialize this node and its descendants in HTML syntax to a new file at the given path.
pub fn text_contents(&self) -> String
pub fn text_contents(&self) -> String
Return the concatenation of all text nodes in this subtree.
pub 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.
pub 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.
pub 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.
pub 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>§
pub fn data(&self) -> &NodeData
pub fn data(&self) -> &NodeData
Return a reference to this node’s node-type-specific data.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub fn detach(&self)
pub fn detach(&self)
Detach a node from its parent and siblings. Children are not affected.
To remove a node and its descendants, detach it and drop any strong reference to it.
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 From<ReferenceLink> for Wikinode
impl From<ReferenceLink> for Wikinode
Source§fn from(node: ReferenceLink) -> Self
fn from(node: ReferenceLink) -> Self
Source§impl From<ReferenceList> for Wikinode
impl From<ReferenceList> for Wikinode
Source§fn from(node: ReferenceList) -> Self
fn from(node: ReferenceList) -> 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 -->
)Source§fn filter_images(&self) -> Vec<Image>
fn filter_images(&self) -> Vec<Image>
Source§fn filter_reference_links(&self) -> Vec<ReferenceLink>
fn filter_reference_links(&self) -> Vec<ReferenceLink>
[1]
. Read moreSource§fn filter_reference_lists(&self) -> Vec<ReferenceList>
fn filter_reference_lists(&self) -> Vec<ReferenceList>
<references>
fn iter_sections(&self) -> Vec<Section>
fn filter_noinclude(&self) -> Vec<NoInclude>
fn filter_onlyinclude(&self) -> Vec<OnlyInclude>
Source§fn next_sibling(&self) -> Option<Wikinode>
fn next_sibling(&self) -> Option<Wikinode>
Source§fn previous_sibling(&self) -> Option<Wikinode>
fn previous_sibling(&self) -> Option<Wikinode>
Source§fn inclusive_ancestors(&self) -> WikinodeMap<Ancestors>
fn inclusive_ancestors(&self) -> WikinodeMap<Ancestors>
Source§fn ancestors(&self) -> WikinodeMap<Ancestors>
fn ancestors(&self) -> WikinodeMap<Ancestors>
Source§fn inclusive_preceding_siblings(&self) -> WikinodeMap<Rev<Siblings>>
fn inclusive_preceding_siblings(&self) -> WikinodeMap<Rev<Siblings>>
Source§fn preceding_siblings(&self) -> WikinodeMap<Rev<Siblings>>
fn preceding_siblings(&self) -> WikinodeMap<Rev<Siblings>>
Source§fn inclusive_following_siblings(&self) -> WikinodeMap<Siblings>
fn inclusive_following_siblings(&self) -> WikinodeMap<Siblings>
Source§fn following_siblings(&self) -> WikinodeMap<Siblings>
fn following_siblings(&self) -> WikinodeMap<Siblings>
Source§fn children(&self) -> WikinodeMap<Siblings>
fn children(&self) -> WikinodeMap<Siblings>
Source§fn inclusive_descendants(&self) -> WikinodeMap<Descendants>
fn inclusive_descendants(&self) -> WikinodeMap<Descendants>
Source§fn descendants(&self) -> WikinodeMap<Descendants>
fn descendants(&self) -> WikinodeMap<Descendants>
Auto Trait Implementations§
impl Freeze for Wikinode
impl !RefUnwindSafe for Wikinode
impl !Send for Wikinode
impl !Sync for Wikinode
impl Unpin for Wikinode
impl !UnwindSafe for Wikinode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)