pub enum AnySource {
Nexus(NexusSource),
GitHub(GitHubSource),
GoogleDrive(GoogleDriveSource),
Mega(MegaSource),
Direct(DirectSource),
}Expand description
Enum dispatch for all download source implementations.
Wraps concrete source types for heterogeneous collections (e.g. Vec<AnySource>).
Each variant implements DownloadSource; the enum delegates via match.
Variants§
Nexus(NexusSource)
GitHub(GitHubSource)
GoogleDrive(GoogleDriveSource)
Mega(MegaSource)
Direct(DirectSource)
Trait Implementations§
Source§impl DownloadSource for AnySource
impl DownloadSource for AnySource
Source§fn can_handle(&self, directive: &DownloadDirective) -> bool
fn can_handle(&self, directive: &DownloadDirective) -> bool
Check if this source can handle the given directive.
Source§async fn resolve(&self, directive: &DownloadDirective) -> Result<DownloadHandle>
async fn resolve(&self, directive: &DownloadDirective) -> Result<DownloadHandle>
Resolve a directive into a download handle with a concrete URL.
Source§async fn download_with_progress(
&self,
handle: DownloadHandle,
dest: &Path,
progress: ProgressCallback,
) -> Result<VerifiedFile>
async fn download_with_progress( &self, handle: DownloadHandle, dest: &Path, progress: ProgressCallback, ) -> Result<VerifiedFile>
Download the file to
dest with progress reporting and verify its hash.Source§fn download(
&self,
handle: DownloadHandle,
dest: &Path,
) -> impl Future<Output = Result<VerifiedFile>> + Send
fn download( &self, handle: DownloadHandle, dest: &Path, ) -> impl Future<Output = Result<VerifiedFile>> + Send
Download the file to
dest and verify its hash (no-op progress).Auto Trait Implementations§
impl Freeze for AnySource
impl !RefUnwindSafe for AnySource
impl Send for AnySource
impl Sync for AnySource
impl Unpin for AnySource
impl UnsafeUnpin for AnySource
impl !UnwindSafe for AnySource
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