Enum tl::Node [−][src]
An HTML Node
Variants
Tag(HTMLTag<'a>)
A regular HTML element/tag
Raw(Bytes<'a>)
Raw text (no particular HTML element)
Comment(Bytes<'a>)
Comment ()
Implementations
impl<'a> Node<'a>
[src]
pub fn inner_text(&self) -> Cow<'a, str>
[src]
Returns the inner text of this node
pub fn find_node<'b, F>(
self: &'b Rc<Node<'a>>,
f: &mut F
) -> Option<&'b Rc<Node<'a>>> where
F: FnMut(&Rc<Node<'a>>) -> bool,
[src]
self: &'b Rc<Node<'a>>,
f: &mut F
) -> Option<&'b Rc<Node<'a>>> where
F: FnMut(&Rc<Node<'a>>) -> bool,
Calls the given closure with each tag as parameter
The closure must return a boolean, indicating whether it should stop iterating
Returning true
will break the loop
pub fn as_tag(&self) -> Option<&HTMLTag<'a>>
[src]
Tries to coerce this node into a HTMLTag
variant
pub fn as_comment(&self) -> Option<&Bytes<'a>>
[src]
Tries to coerce this node into a comment, returning the text
pub fn as_raw(&self) -> Option<&Bytes<'a>>
[src]
Tries to coerce this node into a raw text node, returning the text
“Raw text nodes” are nodes that are not HTML tags, but just text
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Node<'a>
impl<'a> !Send for Node<'a>
impl<'a> !Sync for Node<'a>
impl<'a> Unpin for Node<'a>
impl<'a> !UnwindSafe for Node<'a>
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, 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>,