1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! High-level BitTorrent library.
//!
//! This crate provides the user-facing API for building BitTorrent clients.
//! It depends on [`torrent_core`] for all low-level data types and adds
//! async I/O via tokio for networking, file storage, and session management.
//!
//! # Re-exports
//!
//! Commonly used core types are re-exported for convenience:
//! - [`bencode`], [`error`], [`magnet`], [`metainfo`], [`piece`] from `torrent_core`
//!
//! # Quick Start
//!
//! ```no_run
//! use std::path::PathBuf;
//! use torrent::session::{Session, SessionConfig};
//!
//! # async fn example() {
//! let config = SessionConfig {
//! download_dir: PathBuf::from("./downloads"),
//! ..Default::default()
//! };
//! let session = Session::new(config).await.unwrap();
//!
//! let data = std::fs::read("torrent.torrent").unwrap();
//! let info_hash = session.add_torrent_bytes(&data).await.unwrap();
//! # }
//! ```
// Re-export key core types so users only need `torrent` as a dependency.
pub use ;
// Re-export commonly-used types at the crate root for convenience.
pub use PeerId;