Struct HtmlWalker

Source
pub struct HtmlWalker<'a> {
    pub nodes: &'a [HtmlNode],
    pub index: usize,
    /* private fields */
}

Fields§

§nodes: &'a [HtmlNode]§index: usize

Implementations§

Source§

impl<'a> HtmlWalker<'a>

Source

pub fn index(&self) -> usize

Source

pub fn walk(&mut self)

Source

pub fn jump_to_close(&mut self)

Source

pub fn done(&self) -> bool

Source

pub fn find_attr_lc(&self, flc: LiveId) -> Option<&'a str>

Returns the first attribute of the currently-opened Html tag whose key matches the given flc LiveId, which should be all lowercase.

Matching is done after converting all attribute keys to lowercase.

Source

pub fn while_attr_lc(&mut self) -> Option<(LiveId, &'a str)>

Source

pub fn find_attr_nc(&self, fnc: LiveId) -> Option<&'a str>

Returns the first attribute of the currently-opened Html tag whose key matches the given fnc LiveId, which is case-sensitive.

Matching is done in a case-sensitive manner.

Source

pub fn find_text(&self) -> Option<&'a str>

Source

pub fn find_tag_text(&self, tag: LiveId) -> Option<&'a str>

Source

pub fn text(&self) -> Option<&'a str>

Source

pub fn text_is_all_ws(&self) -> bool

Source

pub fn open_tag_lc(&self) -> Option<LiveId>

Source

pub fn open_tag_nc(&self) -> Option<LiveId>

Source

pub fn open_tag(&self) -> Option<(LiveId, LiveId)>

Source

pub fn close_tag_lc(&self) -> Option<LiveId>

Source

pub fn close_tag_nc(&self) -> Option<LiveId>

Source

pub fn close_tag(&self) -> Option<(LiveId, LiveId)>

Auto Trait Implementations§

§

impl<'a> Freeze for HtmlWalker<'a>

§

impl<'a> RefUnwindSafe for HtmlWalker<'a>

§

impl<'a> Send for HtmlWalker<'a>

§

impl<'a> Sync for HtmlWalker<'a>

§

impl<'a> Unpin for HtmlWalker<'a>

§

impl<'a> UnwindSafe for HtmlWalker<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.