pub struct Collector { /* private fields */ }
Expand description
Collector keeps the state of link collection It drives the link extraction from inputs
Implementations§
Source§impl Collector
impl Collector
Sourcepub fn new(root_dir: Option<PathBuf>, base: Option<Base>) -> Result<Self>
pub fn new(root_dir: Option<PathBuf>, base: Option<Base>) -> Result<Self>
Create a new collector with an empty cache
§Errors
Returns an Err
if the root_dir
is not an absolute path
or if the reqwest Client
fails to build
Sourcepub const fn skip_missing_inputs(self, yes: bool) -> Self
pub const fn skip_missing_inputs(self, yes: bool) -> Self
Skip missing input files (default is to error if they don’t exist)
Skip files that are hidden
Sourcepub const fn skip_ignored(self, yes: bool) -> Self
pub const fn skip_ignored(self, yes: bool) -> Self
Skip files that are ignored
Sourcepub const fn use_html5ever(self, yes: bool) -> Self
pub const fn use_html5ever(self, yes: bool) -> Self
Use html5ever
to parse HTML instead of html5gum
.
Sourcepub const fn include_verbatim(self, yes: bool) -> Self
pub const fn include_verbatim(self, yes: bool) -> Self
Skip over links in verbatim sections (like Markdown code blocks)
Sourcepub const fn include_wikilinks(self, yes: bool) -> Self
pub const fn include_wikilinks(self, yes: bool) -> Self
Check WikiLinks in Markdown files
Sourcepub fn basic_auth_extractor(self, extractor: BasicAuthExtractor) -> Self
pub fn basic_auth_extractor(self, extractor: BasicAuthExtractor) -> Self
Pass a BasicAuthExtractor
which is capable to match found
URIs to basic auth credentials. These credentials get passed to the
request in question.
Sourcepub fn excluded_paths(self, excluded_paths: PathExcludes) -> Self
pub fn excluded_paths(self, excluded_paths: PathExcludes) -> Self
Configure which paths to exclude
Sourcepub fn collect_sources(
self,
inputs: HashSet<Input>,
) -> impl Stream<Item = Result<String>>
pub fn collect_sources( self, inputs: HashSet<Input>, ) -> impl Stream<Item = Result<String>>
Collect all sources from a list of Input
s. For further details,
see also Input::get_sources
.
Sourcepub fn collect_sources_with_file_types(
self,
inputs: HashSet<Input>,
file_extensions: FileExtensions,
) -> impl Stream<Item = Result<String>> + 'static
pub fn collect_sources_with_file_types( self, inputs: HashSet<Input>, file_extensions: FileExtensions, ) -> impl Stream<Item = Result<String>> + 'static
Collect all sources from a list of Input
s with specific file extensions.
Sourcepub fn collect_links(
self,
inputs: HashSet<Input>,
) -> impl Stream<Item = Result<Request>>
pub fn collect_links( self, inputs: HashSet<Input>, ) -> impl Stream<Item = Result<Request>>
Convenience method to fetch all unique links from inputs with the default extensions.
Sourcepub fn collect_links_from_file_types(
self,
inputs: HashSet<Input>,
extensions: FileExtensions,
) -> impl Stream<Item = Result<Request>>
pub fn collect_links_from_file_types( self, inputs: HashSet<Input>, extensions: FileExtensions, ) -> impl Stream<Item = Result<Request>>
Fetch all unique links from inputs
All relative URLs get prefixed with base
(if given).
(This can be a directory or a base URL)
§Errors
Will return Err
if links cannot be extracted from an input
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Collector
impl !RefUnwindSafe for Collector
impl Send for Collector
impl Sync for Collector
impl Unpin for Collector
impl !UnwindSafe for Collector
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