pub struct ExtendedHttpFileDownloader {
pub inner: HttpFileDownloader,
/* private fields */
}
Fields§
§inner: HttpFileDownloader
Implementations§
Source§impl ExtendedHttpFileDownloader
impl ExtendedHttpFileDownloader
pub fn new( downloader: HttpFileDownloader, downloader_wrapper: Box<dyn DownloaderWrapper>, ) -> Self
Sourcepub fn prepare_download(&mut self) -> Result<DownloadFuture, DownloadStartError>
pub fn prepare_download(&mut self) -> Result<DownloadFuture, DownloadStartError>
准备下载,返回了用于下载用的 ’static 的 Future
Sourcepub fn is_downloading(&self) -> bool
pub fn is_downloading(&self) -> bool
是否正在下载
Sourcepub fn change_connection_count(
&self,
connection_count: NonZeroU8,
) -> Result<(), ChangeConnectionCountError>
pub fn change_connection_count( &self, connection_count: NonZeroU8, ) -> Result<(), ChangeConnectionCountError>
更改连接数
Sourcepub fn change_chunk_size(
&self,
chunk_size: NonZeroUsize,
) -> Result<(), ChangeChunkSizeError>
pub fn change_chunk_size( &self, chunk_size: NonZeroUsize, ) -> Result<(), ChangeChunkSizeError>
更改 chunk 大小
Sourcepub fn downloaded_len(&self) -> u64
pub fn downloaded_len(&self) -> u64
已下载长度
Sourcepub fn total_size_future(
&self,
) -> impl Future<Output = Option<NonZeroU64>> + 'static
pub fn total_size_future( &self, ) -> impl Future<Output = Option<NonZeroU64>> + 'static
总大小,会等待服务器响应,如果文件无大小则返回 None
Sourcepub fn current_total_size(&self) -> Option<NonZeroU64>
pub fn current_total_size(&self) -> Option<NonZeroU64>
总大小,如果文件无大小或者还没有得到服务器响应时返回 None
Sourcepub fn atomic_total_size(&self) -> Arc<AtomicU64>
pub fn atomic_total_size(&self) -> Arc<AtomicU64>
总大小的Arc
引用
Sourcepub async fn get_chunks(&self) -> Vec<Arc<ChunkItem>>
pub async fn get_chunks(&self) -> Vec<Arc<ChunkItem>>
获取 chunks
Sourcepub fn get_file_path(&self) -> PathBuf
pub fn get_file_path(&self) -> PathBuf
获取文件路径
Sourcepub fn get_downloading_state(&self) -> Option<Weak<DownloadingState>>
pub fn get_downloading_state(&self) -> Option<Weak<DownloadingState>>
获取 DownloadingState,如果下载没有开始则返回 None
Sourcepub fn config(&self) -> &HttpDownloadConfig
pub fn config(&self) -> &HttpDownloadConfig
配置
Sourcepub fn downloaded_len_receiver(&self) -> &Receiver<u64>
pub fn downloaded_len_receiver(&self) -> &Receiver<u64>
已下载长度接收器
Sourcepub fn downloading_state_receiver(&mut self) -> Receiver<Arc<DownloadingState>>
pub fn downloading_state_receiver(&mut self) -> Receiver<Arc<DownloadingState>>
DownloadingState 接收器
Auto Trait Implementations§
impl Freeze for ExtendedHttpFileDownloader
impl !RefUnwindSafe for ExtendedHttpFileDownloader
impl Send for ExtendedHttpFileDownloader
impl Sync for ExtendedHttpFileDownloader
impl Unpin for ExtendedHttpFileDownloader
impl !UnwindSafe for ExtendedHttpFileDownloader
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