pub struct HttpFileDownloader {
pub downloading_state_oneshot_vec: Vec<Sender<Arc<DownloadingState>>>,
pub downloaded_len_change_notify: Option<Arc<dyn DownloadedLenChangeNotify>>,
pub archive_data_future: Option<Exclusive<BoxFuture<'static, Result<Option<Box<DownloadArchiveData>>>>>>,
pub config: Arc<HttpDownloadConfig>,
pub downloaded_len_receiver: Receiver<u64>,
pub content_length: Arc<AtomicU64>,
pub cancel_token: CancellationToken,
/* private fields */
}Fields§
§downloading_state_oneshot_vec: Vec<Sender<Arc<DownloadingState>>>§downloaded_len_change_notify: Option<Arc<dyn DownloadedLenChangeNotify>>§archive_data_future: Option<Exclusive<BoxFuture<'static, Result<Option<Box<DownloadArchiveData>>>>>>§config: Arc<HttpDownloadConfig>§downloaded_len_receiver: Receiver<u64>§content_length: Arc<AtomicU64>§cancel_token: CancellationTokenImplementations§
Source§impl HttpFileDownloader
impl HttpFileDownloader
pub fn new(client: Client, config: Arc<HttpDownloadConfig>) -> Self
pub fn is_downloading(&self) -> bool
pub fn change_connection_count( &self, connection_count: NonZeroU8, ) -> Result<(), ChangeConnectionCountError>
pub fn change_chunk_size( &self, chunk_size: NonZeroUsize, ) -> Result<(), ChangeChunkSizeError>
pub fn downloaded_len(&self) -> u64
pub fn total_size_future( &self, ) -> impl Future<Output = Option<NonZeroU64>> + 'static
pub fn current_total_size(&self) -> Option<NonZeroU64>
pub fn get_chunk_manager(&self) -> Option<Weak<ChunkManager>>
pub fn get_downloading_state(&self) -> Option<Weak<DownloadingState>>
pub async fn get_chunks(&self) -> Vec<Arc<ChunkItem>>
pub async fn get_chunks_info(&self) -> Option<ChunksInfo>
pub fn get_file_path(&self) -> PathBuf
pub fn take_downloading_state( &self, ) -> Option<(Receiver<DownloadingEndCause>, Arc<DownloadingState>)>
pub fn cancel(&self) -> impl Future<Output = ()> + 'static
Auto Trait Implementations§
impl Freeze for HttpFileDownloader
impl !RefUnwindSafe for HttpFileDownloader
impl Send for HttpFileDownloader
impl Sync for HttpFileDownloader
impl Unpin for HttpFileDownloader
impl !UnwindSafe for HttpFileDownloader
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