Skip to main content

furl_core/
lib.rs

1//! # furl_core
2//!
3//! fURL core package includes different structs and functions that can be used
4//! in your package for downloading files without using `furl-cli`.
5//!
6//! ## Example Usecase
7//!
8//! since the package implements multi-threaded downloading, it is expected to
9//! be used inside an async function.
10//!
11//! please check more about async rust
12//! [here (Async Book)](https://rust-lang.github.io/async-book/).
13//!
14//! or check [tokio](https://crates.io/crates/tokio) package for more detailed implementation.
15//!
16//! ```rust
17//! use furl_core::Downloader;
18//!
19//! #[tokio::main]
20//! async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
21//!     let mut downloader = Downloader::new("https://example.com/files/file_1.txt");
22//!     // download into the tmp directory using default thread count
23//!     downloader.download(".", None).await?;
24//!     Ok(())
25//! }
26//! ```
27pub mod engine;
28
29pub use engine::Downloader;