pub struct Extractor { /* private fields */ }Expand description
A handler for extracting links from various input formats like Markdown and HTML. Allocations should be avoided if possible as this is a performance-critical section of the library.
Implementations§
Source§impl Extractor
impl Extractor
Sourcepub const fn new(
use_html5ever: bool,
include_verbatim: bool,
include_wikilinks: bool,
) -> Self
pub const fn new( use_html5ever: bool, include_verbatim: bool, include_wikilinks: bool, ) -> Self
Creates a new extractor
The extractor can be configured with the following settings:
-
use_html5everenables the alternative HTML parser engine html5ever, that is also used in the Servo browser by Mozilla. The default ishtml5gum, which is more performant and well maintained. -
include_verbatimignores links inside Markdown code blocks. These can be denoted as a block starting with three backticks or an indented block. For more information, consult thepulldown_cmarkdocumentation about code blocks here
Sourcepub fn extract(&self, input_content: &InputContent) -> Vec<RawUri>
pub fn extract(&self, input_content: &InputContent) -> Vec<RawUri>
Main entrypoint for extracting links from various sources (Markdown, HTML, and plaintext)
Trait Implementations§
impl Copy for Extractor
Auto Trait Implementations§
impl Freeze for Extractor
impl RefUnwindSafe for Extractor
impl Send for Extractor
impl Sync for Extractor
impl Unpin for Extractor
impl UnwindSafe for Extractor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more