Skip to main content

fast_down_ffi/
lib.rs

1#![doc = include_str!("../README.md")]
2
3mod config;
4mod download;
5mod error;
6mod event;
7
8pub use config::*;
9pub use download::*;
10pub use error::*;
11pub use event::*;
12pub use fast_down;
13pub use fast_down::{
14    AnyError, BoxPusher, DownloadResult, Event as RawEvent, FileId, InvertIter, Merge,
15    ProgressEntry, PullResult, PullStream, Puller, PullerError, Pusher, Total, UrlInfo, WorkerId,
16    file, handle, http, invert, mem, mock, multi, reqwest as reqwest_adapter, single, utils,
17};
18
19use tokio_util::sync::CancellationToken;
20
21pub type Tx = crossfire::Tx<crossfire::spsc::List<Event>>;
22pub type Rx = crossfire::AsyncRx<crossfire::spsc::List<Event>>;
23
24#[must_use]
25pub fn create_channel() -> (Tx, Rx) {
26    crossfire::spsc::unbounded_async()
27}
28
29#[must_use]
30pub fn create_cancellation_token() -> CancellationToken {
31    CancellationToken::new()
32}