pub struct Selectors { /* private fields */ }Expand description
A collection of Selector items (typically the matches of a CSS
query) with batch operations.
Supports indexing (results[0]) and iteration by value or reference.
Implementations§
Source§impl Selectors
impl Selectors
Sourcepub fn css(&self, selector: &str) -> Selectors
pub fn css(&self, selector: &str) -> Selectors
Run a CSS selector against every item and flatten the results into one collection (order: all matches of the first item, then the second, and so on).
Sourcepub fn re(
&self,
pattern: &str,
replace_entities: bool,
clean_match: bool,
case_sensitive: bool,
) -> Vec<TextHandler>
pub fn re( &self, pattern: &str, replace_entities: bool, clean_match: bool, case_sensitive: bool, ) -> Vec<TextHandler>
Apply a regex to every item’s recursive text and collect all
matches (see Selector::re for the flag semantics).
Sourcepub fn re_first(
&self,
pattern: &str,
replace_entities: bool,
clean_match: bool,
case_sensitive: bool,
) -> Option<TextHandler>
pub fn re_first( &self, pattern: &str, replace_entities: bool, clean_match: bool, case_sensitive: bool, ) -> Option<TextHandler>
Apply a regex across the items in order and return the first match found in any of them.
Sourcepub fn get_first(&self, default: Option<TextHandler>) -> Option<TextHandler>
pub fn get_first(&self, default: Option<TextHandler>) -> Option<TextHandler>
Recursive, stripped text of the first item (see
Selector::get_all_text), or default when the collection is
empty.
Sourcepub fn getall(&self) -> Vec<TextHandler>
pub fn getall(&self) -> Vec<TextHandler>
Recursive, stripped text of every item, one entry per item.
Trait Implementations§
Source§impl IntoIterator for Selectors
impl IntoIterator for Selectors
Auto Trait Implementations§
impl !RefUnwindSafe for Selectors
impl !Send for Selectors
impl !Sync for Selectors
impl !UnwindSafe for Selectors
impl Freeze for Selectors
impl Unpin for Selectors
impl UnsafeUnpin for Selectors
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more