fast-down-ffi 0.2.8

这个库旨在提供一个合适、易于使用的 fast-down 包装
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use fast_down::http::HttpError;
use reqwest::Client;
use std::sync::Arc;
use tokio::task::JoinError;

#[derive(thiserror::Error, Debug)]
pub enum Error {
    #[error("IO error: {0}")]
    Io(String),
    #[error("Network error: {0:?}")]
    Request(#[from] reqwest::Error),
    #[error("Task error: {0:?}")]
    Task(#[from] Arc<JoinError>),
    #[error("Prefetch timeout: {0:?}")]
    PrefetchTimeout(HttpError<Client>),
    #[error("Task is already running")]
    AlreadyRunning,
}