[][src]Struct extrablatt::clean::CommonCleaner

pub struct CommonCleaner<P> where
    P: Fn(Node<'_>) -> bool
{ pub bad_node_names: HashSet<Cow<'static, str>>, pub is_good_node: P, }

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]

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]

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]

impl Default for CommonCleaner<fn's(_: Node<'s>) -> bool>[src]

impl<P> DocumentCleaner for CommonCleaner<P> where
    P: Fn(Node<'_>) -> bool
[src]

fn is_bad_node_name(&self, node: Node<'_>) -> bool[src]

Whether the node's should be ignored based on its name

Auto Trait Implementations

impl<P> RefUnwindSafe for CommonCleaner<P> where
    P: RefUnwindSafe

impl<P> Send for CommonCleaner<P> where
    P: Send

impl<P> Sync for CommonCleaner<P> where
    P: Sync

impl<P> Unpin for CommonCleaner<P> where
    P: Unpin

impl<P> UnwindSafe for CommonCleaner<P> where
    P: UnwindSafe

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, 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,