Struct parsoid::node::LanguageLink [−][src]
Represents a language link ([[en:Foo]]
)
let link = LanguageLink::new("https://en.wikipedia.org/wiki/Foo"); assert_eq!( &link.target(), "https://en.wikipedia.org/wiki/Foo" ); assert_eq!( &link.to_string(), "<link href=\"https://en.wikipedia.org/wiki/Foo\" rel=\"mw:PageProp/Language\">" );
See the spec for more details.
Implementations
impl LanguageLink
[src]
pub fn new(target: &str) -> Self
[src]
Create a new external link
pub fn target(&self) -> String
[src]
Get the link target
pub fn set_target(&self, target: &str)
[src]
Set a new link target
Methods from Deref<Target = NodeRef>
pub fn inclusive_ancestors(&self) -> Ancestors
[src]
Return an iterator of references to this node and its ancestors.
pub fn ancestors(&self) -> Ancestors
[src]
Return an iterator of references to this node’s ancestors.
pub fn inclusive_preceding_siblings(&self) -> Rev<Siblings>
[src]
Return an iterator of references to this node and the siblings before it.
pub fn preceding_siblings(&self) -> Rev<Siblings>
[src]
Return an iterator of references to this node’s siblings before it.
pub fn inclusive_following_siblings(&self) -> Siblings
[src]
Return an iterator of references to this node and the siblings after it.
pub fn following_siblings(&self) -> Siblings
[src]
Return an iterator of references to this node’s siblings after it.
pub fn children(&self) -> Siblings
[src]
Return an iterator of references to this node’s children.
pub fn inclusive_descendants(&self) -> Descendants
[src]
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
[src]
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
[src]
Return an iterator of the start and end edges of this node and its descendants, in tree order.
pub fn traverse(&self) -> Traverse
[src]
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>, Selectors>, ()>
[src]
&self,
selectors: &str
) -> Result<Select<Elements<Descendants>, Selectors>, ()>
Return an iterator of the inclusive descendants element that match the given selector list.
pub fn select_first(
&self,
selectors: &str
) -> Result<NodeDataRef<ElementData>, ()>
[src]
&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,
[src]
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> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
Serialize this node and its descendants in HTML syntax to a new file at the given path.
pub fn text_contents(&self) -> String
[src]
Return the concatenation of all text nodes in this subtree.
pub fn append(&self, new_child: NodeRef)
[src]
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)
[src]
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)
[src]
Insert a new sibling after this node.
The new sibling is detached from its previous position.
pub fn insert_before(&self, new_sibling: NodeRef)
[src]
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
[src]
Return a reference to this node’s node-type-specific data.
pub fn as_element(&self) -> Option<&ElementData>
[src]
If this node is an element, return a reference to element-specific data.
pub fn as_text(&self) -> Option<&RefCell<String>>
[src]
If this node is a text node, return a reference to its contents.
pub fn as_comment(&self) -> Option<&RefCell<String>>
[src]
If this node is a comment, return a reference to its contents.
pub fn as_doctype(&self) -> Option<&Doctype>
[src]
If this node is a document, return a reference to doctype-specific data.
pub fn as_document(&self) -> Option<&DocumentData>
[src]
If this node is a document, return a reference to document-specific data.
pub fn parent(&self) -> Option<NodeRef>
[src]
Return a reference to the parent node, unless this node is the root of the tree.
pub fn first_child(&self) -> Option<NodeRef>
[src]
Return a reference to the first child of this node, unless it has no child.
pub fn last_child(&self) -> Option<NodeRef>
[src]
Return a reference to the last child of this node, unless it has no child.
pub fn previous_sibling(&self) -> Option<NodeRef>
[src]
Return a reference to the previous sibling of this node, unless it is a first child.
pub fn next_sibling(&self) -> Option<NodeRef>
[src]
Return a reference to the next sibling of this node, unless it is a last child.
pub fn detach(&self)
[src]
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
impl Clone for LanguageLink
[src]
fn clone(&self) -> LanguageLink
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for LanguageLink
[src]
impl Deref for LanguageLink
[src]
impl From<LanguageLink> for Wikinode
[src]
fn from(node: LanguageLink) -> Self
[src]
impl WikinodeIterator for LanguageLink
[src]
fn as_node(&self) -> &NodeRef
[src]
fn append(&self, code: &NodeRef)
[src]
fn prepend(&self, code: &NodeRef)
[src]
fn insert_after(&self, code: &NodeRef)
[src]
fn insert_before(&self, code: &NodeRef)
[src]
fn select(&self, selector: &str) -> Vec<Wikinode>
[src]
fn select_first(&self, selector: &str) -> Option<Wikinode>
[src]
fn filter_links(&self) -> Vec<WikiLink>
[src]
fn filter_external_links(&self) -> Vec<ExtLink>
[src]
fn filter_categories(&self) -> Vec<Category>
[src]
fn filter_templates(&self) -> Result<Vec<Template>>
[src]
fn filter_parser_functions(&self) -> Result<Vec<Template>>
[src]
fn iter_sections(&self) -> Vec<Section>
[src]
fn inclusive_ancestors(&self) -> WikinodeMap<Ancestors>
[src]
fn ancestors(&self) -> WikinodeMap<Ancestors>
[src]
fn inclusive_preceding_siblings(&self) -> WikinodeMap<Rev<Siblings>>
[src]
fn preceding_simblings(&self) -> WikinodeMap<Rev<Siblings>>
[src]
fn inclusive_following_siblings(&self) -> WikinodeMap<Siblings>
[src]
fn following_siblings(&self) -> WikinodeMap<Siblings>
[src]
fn children(&self) -> WikinodeMap<Siblings>
[src]
fn inclusive_descendants(&self) -> WikinodeMap<Descendants>
[src]
fn descendants(&self) -> WikinodeMap<Descendants>
[src]
Auto Trait Implementations
impl !RefUnwindSafe for LanguageLink
[src]
impl !Send for LanguageLink
[src]
impl !Sync for LanguageLink
[src]
impl Unpin for LanguageLink
[src]
impl !UnwindSafe for LanguageLink
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,