pub struct Jobs { /* private fields */ }Implementations§
Source§impl Jobs
impl Jobs
pub async fn get<R>(&self, id: &str, f: impl FnOnce(&Job) -> R) -> Option<R>
pub async fn cancel(&self, id: &str) -> bool
pub async fn active(&self) -> Vec<String>
Sourcepub async fn start_batch(
&self,
engine: Arc<dyn Engine>,
urls: Vec<String>,
opts: ScrapeOptions,
concurrency: usize,
) -> String
pub async fn start_batch( &self, engine: Arc<dyn Engine>, urls: Vec<String>, opts: ScrapeOptions, concurrency: usize, ) -> String
启动批量抓取,立即返回任务 id;每个 URL 的结果和错误陆续写入任务。
Sourcepub async fn start_crawl(
&self,
engine: Arc<dyn Engine>,
req: CrawlRequest,
) -> String
pub async fn start_crawl( &self, engine: Arc<dyn Engine>, req: CrawlRequest, ) -> String
启动整站爬取,立即返回任务 id。
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Jobs
impl !UnwindSafe for Jobs
impl Freeze for Jobs
impl Send for Jobs
impl Sync for Jobs
impl Unpin for Jobs
impl UnsafeUnpin for Jobs
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