pub struct DiscoveryConfig {
pub mode: DiscoveryMode,
pub discover_sitemaps: bool,
pub max_sitemap_depth: usize,
pub extract_page_metadata: bool,
pub link_extract_options: LinkExtractOptions,
pub rules: Vec<DiscoveryRule>,
}Expand description
Discovery-specific runtime configuration.
Fields§
§mode: DiscoveryModeHow the runtime should discover follow-up work from responses.
discover_sitemaps: boolWhether sitemap XML should be parsed into follow-up requests.
max_sitemap_depth: usizeMaximum recursion depth for nested sitemap indexes.
extract_page_metadata: boolWhether page metadata should be extracted and attached to response metadata.
link_extract_options: LinkExtractOptionsBase link extraction options used for HTML discovery.
rules: Vec<DiscoveryRule>Optional rule-like link discovery behavior matched against source responses.
Implementations§
Source§impl DiscoveryConfig
impl DiscoveryConfig
Sourcepub fn with_mode(self, mode: DiscoveryMode) -> Self
pub fn with_mode(self, mode: DiscoveryMode) -> Self
Sets the discovery mode.
Sourcepub fn with_sitemaps(self, enabled: bool) -> Self
pub fn with_sitemaps(self, enabled: bool) -> Self
Enables or disables sitemap parsing.
Sourcepub fn with_max_sitemap_depth(self, depth: usize) -> Self
pub fn with_max_sitemap_depth(self, depth: usize) -> Self
Sets the maximum nested sitemap depth.
Sourcepub fn with_page_metadata(self, enabled: bool) -> Self
pub fn with_page_metadata(self, enabled: bool) -> Self
Enables or disables page metadata extraction.
Sourcepub fn with_link_extract_options(self, options: LinkExtractOptions) -> Self
pub fn with_link_extract_options(self, options: LinkExtractOptions) -> Self
Replaces the base link extraction options.
Sourcepub fn with_rules(self, rules: impl IntoIterator<Item = DiscoveryRule>) -> Self
pub fn with_rules(self, rules: impl IntoIterator<Item = DiscoveryRule>) -> Self
Replaces the configured discovery rules.
Sourcepub fn with_rule(self, rule: DiscoveryRule) -> Self
pub fn with_rule(self, rule: DiscoveryRule) -> Self
Adds a single discovery rule.
Sourcepub fn with_same_site_only(self, enabled: bool) -> Self
pub fn with_same_site_only(self, enabled: bool) -> Self
Sets whether only same-site links should be discovered.
Sourcepub fn with_text_links(self, enabled: bool) -> Self
pub fn with_text_links(self, enabled: bool) -> Self
Sets whether text content should be scanned for plain-text URLs.
Sourcepub fn with_allow_patterns(
self,
patterns: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_allow_patterns( self, patterns: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Restricts discovery to URLs that match at least one glob-style pattern.
Sourcepub fn with_deny_patterns(
self,
patterns: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_deny_patterns( self, patterns: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Excludes URLs that match any glob-style pattern.
Sourcepub fn with_allow_domains(
self,
domains: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_allow_domains( self, domains: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Restricts discovery to the given domains or subdomains.
Sourcepub fn with_deny_domains(
self,
domains: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_deny_domains( self, domains: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Excludes discovery for the given domains or subdomains.
Sourcepub fn with_allow_path_prefixes(
self,
prefixes: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_allow_path_prefixes( self, prefixes: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Restricts discovery to URL paths with one of the provided prefixes.
Sourcepub fn with_deny_path_prefixes(
self,
prefixes: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_deny_path_prefixes( self, prefixes: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Excludes URL paths with one of the provided prefixes.
Restricts attribute extraction to specific HTML tags.
Sourcepub fn with_allowed_attributes(
self,
attributes: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_allowed_attributes( self, attributes: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Restricts attribute extraction to specific attributes.
Sourcepub fn with_allowed_link_types(
self,
link_types: impl IntoIterator<Item = LinkType>,
) -> Self
pub fn with_allowed_link_types( self, link_types: impl IntoIterator<Item = LinkType>, ) -> Self
Restricts discovery to the provided link types.
Sourcepub fn with_denied_link_types(
self,
link_types: impl IntoIterator<Item = LinkType>,
) -> Self
pub fn with_denied_link_types( self, link_types: impl IntoIterator<Item = LinkType>, ) -> Self
Excludes the provided link types from discovery.
Sourcepub fn effective_link_extract_options(&self) -> Option<LinkExtractOptions>
pub fn effective_link_extract_options(&self) -> Option<LinkExtractOptions>
Returns the effective link extraction options for the configured mode.
Sourcepub fn effective_link_extract_options_for(
&self,
options: LinkExtractOptions,
) -> Option<LinkExtractOptions>
pub fn effective_link_extract_options_for( &self, options: LinkExtractOptions, ) -> Option<LinkExtractOptions>
Returns the effective link extraction options for a specific rule or override.
Sourcepub fn should_extract_metadata(&self) -> bool
pub fn should_extract_metadata(&self) -> bool
Returns true when metadata extraction should run.
Trait Implementations§
Source§impl Clone for DiscoveryConfig
impl Clone for DiscoveryConfig
Source§fn clone(&self) -> DiscoveryConfig
fn clone(&self) -> DiscoveryConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DiscoveryConfig
impl Debug for DiscoveryConfig
Source§impl Default for DiscoveryConfig
impl Default for DiscoveryConfig
Source§impl PartialEq for DiscoveryConfig
impl PartialEq for DiscoveryConfig
impl Eq for DiscoveryConfig
impl StructuralPartialEq for DiscoveryConfig
Auto Trait Implementations§
impl Freeze for DiscoveryConfig
impl RefUnwindSafe for DiscoveryConfig
impl Send for DiscoveryConfig
impl Sync for DiscoveryConfig
impl Unpin for DiscoveryConfig
impl UnsafeUnpin for DiscoveryConfig
impl UnwindSafe for DiscoveryConfig
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.