pub struct DownloadManager { /* private fields */ }Implementations§
Source§impl DownloadManager
impl DownloadManager
Sourcepub fn new(max_concurrent: usize) -> Self
pub fn new(max_concurrent: usize) -> Self
Create a new ‘DownloadManager’ and specify the maximum number of concurrent downloads The default timeout is set to 60 seconds
§Arguments
max_concurrent- Maximum number of concurrent downloads
Sourcepub fn with_client(client: Client, max_concurrent: usize) -> Self
pub fn with_client(client: Client, max_concurrent: usize) -> Self
Create a ‘DownloadManager’ with a custom ‘Client’
Sourcepub async fn download_photo<P: AsRef<Path>>(
&self,
photo: &Photo,
output_dir: P,
quality: ImageQuality,
) -> Result<PathBuf, PexelsError>
pub async fn download_photo<P: AsRef<Path>>( &self, photo: &Photo, output_dir: P, quality: ImageQuality, ) -> Result<PathBuf, PexelsError>
Sourcepub async fn download_video<P: AsRef<Path>>(
&self,
video: &Video,
output_dir: P,
quality: VideoQuality,
) -> Result<PathBuf, PexelsError>
pub async fn download_video<P: AsRef<Path>>( &self, video: &Video, output_dir: P, quality: VideoQuality, ) -> Result<PathBuf, PexelsError>
Sourcepub async fn batch_download_photos<P: AsRef<Path>>(
&self,
photos: &[Photo],
output_dir: P,
quality: ImageQuality,
progress_callback: Option<ProgressCallback>,
) -> Result<Vec<PathBuf>, PexelsError>
pub async fn batch_download_photos<P: AsRef<Path>>( &self, photos: &[Photo], output_dir: P, quality: ImageQuality, progress_callback: Option<ProgressCallback>, ) -> Result<Vec<PathBuf>, PexelsError>
Sourcepub async fn batch_download_videos<P: AsRef<Path>>(
&self,
videos: &[Video],
output_dir: P,
quality: VideoQuality,
progress_callback: Option<ProgressCallback>,
) -> Result<Vec<PathBuf>, PexelsError>
pub async fn batch_download_videos<P: AsRef<Path>>( &self, videos: &[Video], output_dir: P, quality: VideoQuality, progress_callback: Option<ProgressCallback>, ) -> Result<Vec<PathBuf>, PexelsError>
Auto Trait Implementations§
impl Freeze for DownloadManager
impl !RefUnwindSafe for DownloadManager
impl Send for DownloadManager
impl Sync for DownloadManager
impl Unpin for DownloadManager
impl !UnwindSafe for DownloadManager
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