fast-down-ffi 0.2.5

这个库旨在提供一个合适、易于使用的 fast-down 包装
Documentation
#![doc = include_str!("../README.md")]

mod config;
mod download;
mod error;
mod event;

pub use config::*;
pub use download::*;
pub use error::*;
pub use event::*;
pub use fast_down;
pub use fast_down::{
    AnyError, BoxPusher, DownloadResult, Event as RawEvent, FileId, InvertIter, Merge,
    ProgressEntry, Proxy, PullResult, PullStream, Puller, PullerError, Pusher, Total, UrlInfo,
    WorkerId, fast_puller, getifaddrs, handle, http, invert, mock, multi,
    reqwest as reqwest_adapter, single, unique_path,
};

#[cfg(feature = "file")]
pub use fast_down::file;
#[cfg(feature = "mem")]
pub use fast_down::mem;

use tokio_util::sync::CancellationToken;

pub type Tx = crossfire::MTx<crossfire::spsc::List<Event>>;
pub type Rx = crossfire::AsyncRx<crossfire::spsc::List<Event>>;

#[must_use]
pub fn create_channel() -> (Tx, Rx) {
    crossfire::mpsc::unbounded_async()
}

#[must_use]
pub fn create_cancellation_token() -> CancellationToken {
    CancellationToken::new()
}