Struct mwbot::parsoid::Redirect [−][src]
pub struct Redirect(_);
Expand description
Represents a redirect (#REDIRECT [[Foo]]
)
let link = Redirect::new("Foo bar");
assert_eq!(
&link.target(),
"Foo bar"
);
assert_eq!(
&link.raw_target(),
"./Foo_bar"
);
assert_eq!(
&link.to_string(),
"<link href=\"./Foo_bar\" rel=\"mw:PageProp/redirect\">"
);
See the spec for more details.
Implementations
Get the raw link target, usually beginning with ./
Get the link target, usually a page title but might also be an external URL
Set a new link target
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.
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.
Serialize this node and its descendants in HTML syntax to the given stream.
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.
Trait Implementations
Insert a node after the current node, as a sibling
Insert a node before the current node, as a sibling
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]
)
Get a list of all categories
Get a list of all comments (<!-- example -->
)
Get a list of parser functions.
Return an iterator of references to this node and its ancestors.
Return an iterator of references to this node’s ancestors.
Return an iterator of references to this node and the siblings before it.
Return an iterator of references to this node’s siblings before it.
Return an iterator of references to this node and the siblings after it.
Return an iterator of references to this node’s siblings after it.
Return an iterator of references to this node’s children.
Return an iterator of references to this node and its descendants, in tree order. Parent nodes appear before the descendants. Read more
Return an iterator of references to this node’s descendants, in tree order. Parent nodes appear before the descendants. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Redirect
impl !UnwindSafe for Redirect
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more