pub struct LinkExtractOptions {
pub same_site_only: bool,
pub include_text_links: bool,
pub sources: Vec<LinkSource>,
pub allowed_link_types: Option<Vec<LinkType>>,
}Expand description
Options that control link extraction from a Response.
The defaults are intentionally conservative for crawler use: same-site filtering is enabled, text links are included, and common HTML elements are scanned for navigable URLs.
Fields§
§same_site_only: boolRestrict discovered links to the same registered domain.
include_text_links: boolInclude URLs found in text content.
sources: Vec<LinkSource>HTML sources used to discover attribute-based links.
allowed_link_types: Option<Vec<LinkType>>Optional allow-list of link types to include.
Implementations§
Source§impl LinkExtractOptions
impl LinkExtractOptions
Sourcepub fn same_site_only(self, same_site_only: bool) -> Self
pub fn same_site_only(self, same_site_only: bool) -> Self
Sets whether only same-site URLs should be returned.
Sourcepub fn include_text_links(self, include_text_links: bool) -> Self
pub fn include_text_links(self, include_text_links: bool) -> Self
Sets whether URLs found in text content should be returned.
Sourcepub fn with_sources(self, sources: impl IntoIterator<Item = LinkSource>) -> Self
pub fn with_sources(self, sources: impl IntoIterator<Item = LinkSource>) -> Self
Replaces the configured HTML extraction sources.
Sourcepub fn add_source(self, source: LinkSource) -> Self
pub fn add_source(self, source: LinkSource) -> Self
Adds an HTML extraction source.
Sourcepub fn with_allowed_link_types(
self,
allowed_link_types: impl IntoIterator<Item = LinkType>,
) -> Self
pub fn with_allowed_link_types( self, allowed_link_types: impl IntoIterator<Item = LinkType>, ) -> Self
Restricts extraction to the provided link types.
Trait Implementations§
Source§impl Clone for LinkExtractOptions
impl Clone for LinkExtractOptions
Source§fn clone(&self) -> LinkExtractOptions
fn clone(&self) -> LinkExtractOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LinkExtractOptions
impl Debug for LinkExtractOptions
Source§impl Default for LinkExtractOptions
impl Default for LinkExtractOptions
Source§impl PartialEq for LinkExtractOptions
impl PartialEq for LinkExtractOptions
impl Eq for LinkExtractOptions
impl StructuralPartialEq for LinkExtractOptions
Auto Trait Implementations§
impl Freeze for LinkExtractOptions
impl RefUnwindSafe for LinkExtractOptions
impl Send for LinkExtractOptions
impl Sync for LinkExtractOptions
impl Unpin for LinkExtractOptions
impl UnsafeUnpin for LinkExtractOptions
impl UnwindSafe for LinkExtractOptions
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