hightorrent/
lib.rs

1//! HighTorrent is a library which contains high-level data structures and functions
2//! to interact with Bittorrent v1 and v2 torrents. HighTorrent does not aim to be featureful,
3//! but rather to be super easy to use and interoperate with more advanced torrent software,
4//! and completely impossible to misuse.
5//!
6//! **Note that HighTorrent is not a networked library. It will not provide any utilities for
7//! querying the DHT and/or downloading torrents. HighTorrent is much lower in the stack.**
8//!
9//! HighTorrent provides utilities to extract name and hash from torrents/magnets, using the
10//! [`MagnetLink`](crate::magnet::MagnetLink) and [`TorrentFile`](crate::torrent_file::TorrentFile) structures, but could provide more advanced utilities in the future (PRs welcome). Additionally, it provides the [`Torrent`](crate::torrent::Torrent) struct and the
11//! [`IntoTorrent`](crate::torrent::IntoTorrent) trait representing fully-loaded torrents ; those helpers are intended to be used by more diverse torrenting libraries to provide interoperability out-of-the-box.
12//!
13//! Finally, the [`SingleTarget`](crate::target::SingleTarget) and
14//! [`MultiTarget`](crate::target::MultiTarget) structures represent one or more torrents you wish to
15//! interact with. The contained stringy value is ambiguous, and can represent either a precise
16//! [`InfoHash`](crate::hash::InfoHash) or a libtorrent-compatible [`TorrentID`](crate::id::TorrentID) (truncated hash).
17
18#[macro_use]
19extern crate serde;
20
21mod hash;
22pub use hash::{InfoHash, InfoHashError, TryInfoHash};
23
24mod id;
25pub use id::TorrentID;
26
27mod list;
28pub use list::TorrentList;
29
30mod magnet;
31pub use magnet::{MagnetLink, MagnetLinkError};
32
33mod torrent;
34pub use torrent::{ToTorrent, Torrent};
35
36mod torrent_file;
37pub use torrent_file::{TorrentFile, TorrentFileError};
38
39mod target;
40pub use target::{MultiTarget, SingleTarget, ToSingleTarget};
41
42mod tracker;
43pub use tracker::{PeerSource, Tracker, TrackerError, TrackerScheme, TryIntoTracker};