[][src]Struct marked::Node

pub struct Node { /* fields omitted */ }

A typed node (e.g. text, element, etc.) within a Document including identifiers to parent, siblings and children.

Implementations

impl Node[src]

pub fn new_elem(element: Element) -> Node[src]

Construct a new element node.

pub fn new_text<T>(text: T) -> Node where
    T: Into<StrTendril>, 
[src]

Construct a new text node.

Methods from Deref<Target = NodeData>

pub fn as_element(&self) -> Option<&Element>[src]

Return Element is this is an element.

pub fn as_element_mut(&mut self) -> Option<&mut Element>[src]

Return mutable Element reference if this is an element.

pub fn as_text(&self) -> Option<&StrTendril>[src]

Return text (char data) if this is a text node.

pub fn as_text_mut(&mut self) -> Option<&mut StrTendril>[src]

Return mutable text (char data) reference if this is a text node.

pub fn attr<LN>(&self, lname: LN) -> Option<&StrTendril> where
    LN: Into<LocalName>, 
[src]

Return attribute value by given local attribute name, if this is an element with that attribute present.

pub fn is_elem<LN>(&self, lname: LN) -> bool where
    LN: Into<LocalName>, 
[src]

Return true if this Node is an element with the given local name.

Trait Implementations

impl Clone for Node[src]

impl Debug for Node[src]

impl Deref for Node[src]

type Target = NodeData

The resulting type after dereferencing.

impl DerefMut for Node[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.