#[non_exhaustive]pub struct EnqueueLinksOptions<'a> { /* private fields */ }Expand description
Fluent options for one URLs-only enqueue operation.
§Examples
use millipede_core::prelude::*;
use url::Url;
let result = EnqueueLinker::new(ctx.crawler.clone(), &ctx.request)
.options()
.raw_urls(["child", "/about"])
.base_url(Url::parse("https://example.com/docs/")?)
.label("detail")
.limit(10)
.send()
.await?;
assert!(result.added.len() + result.skipped.len() <= 2);Implementations§
Source§impl<'a> EnqueueLinksOptions<'a>
impl<'a> EnqueueLinksOptions<'a>
Sourcepub fn urls(self, urls: impl IntoIterator<Item = Url>) -> Self
pub fn urls(self, urls: impl IntoIterator<Item = Url>) -> Self
Extends the explicit absolute URL candidates.
These candidates bypass enqueue-strategy relationship filtering, including the default
EnqueueStrategy::SameHostname. Other filters and crawl-policy limits still apply.
Sourcepub fn raw_urls<S: Into<String>>(
self,
urls: impl IntoIterator<Item = S>,
) -> Self
pub fn raw_urls<S: Into<String>>( self, urls: impl IntoIterator<Item = S>, ) -> Self
Extends raw absolute or relative URL candidates.
Sourcepub fn base_url(self, base_url: Url) -> Self
pub fn base_url(self, base_url: Url) -> Self
Overrides the base used to resolve raw relative URLs.
Sourcepub fn label(self, label: impl Into<String>) -> Self
pub fn label(self, label: impl Into<String>) -> Self
Applies a label to every child. Children do not inherit the parent label; without this option they remain unlabeled and use the router’s default route.
Sourcepub fn selector(self, selector: impl Into<String>) -> Self
pub fn selector(self, selector: impl Into<String>) -> Self
Selects links from the associated HTML context with a CSS selector.
Sourcepub fn strategy(self, strategy: EnqueueStrategy) -> Self
pub fn strategy(self, strategy: EnqueueStrategy) -> Self
Overrides the crawler policy’s URL relationship strategy.
Sourcepub fn globs<G: Into<GlobPattern>>(
self,
globs: impl IntoIterator<Item = G>,
) -> Self
pub fn globs<G: Into<GlobPattern>>( self, globs: impl IntoIterator<Item = G>, ) -> Self
Adds URL include patterns. A candidate may match any glob or regex include.
Sourcepub fn regex(self, patterns: impl IntoIterator<Item = Regex>) -> Self
pub fn regex(self, patterns: impl IntoIterator<Item = Regex>) -> Self
Adds regular-expression URL includes.
Sourcepub fn exclude<P: Into<UrlPattern>>(
self,
patterns: impl IntoIterator<Item = P>,
) -> Self
pub fn exclude<P: Into<UrlPattern>>( self, patterns: impl IntoIterator<Item = P>, ) -> Self
Adds URL exclusions. Exclusions take precedence over includes.
Sourcepub fn transform<F>(self, transform: F) -> Self
pub fn transform<F>(self, transform: F) -> Self
Installs an asynchronous request transform that may mutate or reject each candidate.
Sourcepub fn limit(self, limit: usize) -> Self
pub fn limit(self, limit: usize) -> Self
Caps the number of candidates after URL deduplication. Truncated candidates are silently omitted, and queue duplicates within the retained candidates consume the cap.
Sourcepub fn forefront(self, forefront: bool) -> Self
pub fn forefront(self, forefront: bool) -> Self
Chooses whether children are inserted at the queue front.
Sourcepub async fn send(self) -> Result<EnqueueResult, CrawlError>
pub async fn send(self) -> Result<EnqueueResult, CrawlError>
Resolves, builds, and enqueues candidates through one admission-controlled operation.