pub struct DownloadTool { /* private fields */ }
Expand description
Paper download tool implementation
Implementations§
Source§impl DownloadTool
impl DownloadTool
Sourcepub fn new(client: Arc<MetaSearchClient>, config: Arc<Config>) -> Result<Self>
pub fn new(client: Arc<MetaSearchClient>, config: Arc<Config>) -> Result<Self>
Create a new download tool
Sourcepub fn set_progress_callback(&mut self, callback: ProgressCallback)
pub fn set_progress_callback(&mut self, callback: ProgressCallback)
Set progress callback for download notifications
Sourcepub async fn download_paper(
&self,
input: DownloadInput,
) -> Result<DownloadResult>
pub async fn download_paper( &self, input: DownloadInput, ) -> Result<DownloadResult>
Download a paper by DOI or URL
Sourcepub async fn get_active_downloads(&self) -> Vec<DownloadProgress>
pub async fn get_active_downloads(&self) -> Vec<DownloadProgress>
Get active downloads
Sourcepub async fn cancel_download(&self, download_id: &str) -> Result<()>
pub async fn cancel_download(&self, download_id: &str) -> Result<()>
Cancel a download
Sourcepub async fn get_queue_status(&self) -> Vec<DownloadQueueItem>
pub async fn get_queue_status(&self) -> Vec<DownloadQueueItem>
Get download queue status
Sourcepub async fn clear_completed(&self)
pub async fn clear_completed(&self)
Clear completed downloads from tracking
Trait Implementations§
Source§impl Clone for DownloadTool
impl Clone for DownloadTool
Source§fn clone(&self) -> DownloadTool
fn clone(&self) -> DownloadTool
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 moreAuto Trait Implementations§
impl Freeze for DownloadTool
impl !RefUnwindSafe for DownloadTool
impl Send for DownloadTool
impl Sync for DownloadTool
impl Unpin for DownloadTool
impl !UnwindSafe for DownloadTool
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
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>
Converts
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>
Converts
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