[−][src]Struct extrablatt::clean::CommonCleaner
A DocumentCleaner
that uses names to detect tags to ignore by default
and a predicate to decide whether a tag should be ignore
Fields
bad_node_names: HashSet<Cow<'static, str>>
html tag names that are ignore by default
is_good_node: P
Predicate to decide whether a node can hold valid textual content
Implementations
impl<P> CommonCleaner<P> where
P: Fn(Node<'_>) -> bool,
[src]
P: Fn(Node<'_>) -> bool,
pub fn new(is_good_node: P) -> Self
[src]
Create a new Cleaner that ignores BAD_TAG_NAMES
nodes by default and
decides whether to extract text from a node based on the is_good_node
predicate
pub fn with_names<T, I>(is_good_node: P, bad_names: T) -> Self where
T: IntoIterator<Item = I>,
I: Into<Cow<'static, str>>,
[src]
T: IntoIterator<Item = I>,
I: Into<Cow<'static, str>>,
Create a new Cleaner that ignores bad_names
nodes by default and
decides whether to extract text from a node based on the is_good_node
predicate
Trait Implementations
impl<P: Debug> Debug for CommonCleaner<P> where
P: Fn(Node<'_>) -> bool,
[src]
P: Fn(Node<'_>) -> bool,
impl Default for CommonCleaner<fn's(_: Node<'s>) -> bool>
[src]
impl<P> DocumentCleaner for CommonCleaner<P> where
P: Fn(Node<'_>) -> bool,
[src]
P: Fn(Node<'_>) -> bool,
fn is_good_node(&self, node: Node<'_>) -> bool
[src]
fn is_bad_node_name(&self, node: Node<'_>) -> bool
[src]
Whether the node's should be ignored based on its name
fn clean_node_text(&self, node: Node<'_>) -> String
[src]
fn iter_clean_nodes<'a>(&'a self, node: Node<'a>) -> CleanNodeIter<'a, Self>ⓘNotable traits for CleanNodeIter<'a, T>
impl<'a, T: DocumentCleaner> Iterator for CleanNodeIter<'a, T> type Item = Node<'a>;
where
Self: Sized,
[src]
Notable traits for CleanNodeIter<'a, T>
impl<'a, T: DocumentCleaner> Iterator for CleanNodeIter<'a, T> type Item = Node<'a>;
Self: Sized,
Auto Trait Implementations
impl<P> RefUnwindSafe for CommonCleaner<P> where
P: RefUnwindSafe,
P: RefUnwindSafe,
impl<P> Send for CommonCleaner<P> where
P: Send,
P: Send,
impl<P> Sync for CommonCleaner<P> where
P: Sync,
P: Sync,
impl<P> Unpin for CommonCleaner<P> where
P: Unpin,
P: Unpin,
impl<P> UnwindSafe for CommonCleaner<P> where
P: UnwindSafe,
P: UnwindSafe,
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,
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, 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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,