Expand description
HighTorrent is a library which contains high-level data structures and functions to interact with Bittorrent v1 and v2 torrents. HighTorrent does not aim to be featureful, but rather to be super easy to use and interoperate with more advanced torrent software, and completely impossible to misuse.
Note that HighTorrent is not a networked library. It will not provide any utilities for querying the DHT and/or downloading torrents. HighTorrent is much lower in the stack.
HighTorrent provides utilities to extract name and hash from torrents/magnets, using the
MagnetLink
and TorrentFile
structures, but could provide more advanced utilities in the future (PRs welcome). Additionally, it provides the Torrent
struct and the
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.
Finally, the SingleTarget
and
MultiTarget
structures represent one or more torrents you wish to
interact with. The contained stringy value is ambiguous, and can represent either a precise
InfoHash
or a libtorrent-compatible TorrentID
(truncated hash).
Structs§
- Magnet
Link - A Magnet URI, which contains the infohash(es) but not the entire meta info.
- Single
Target - A single Torrent to interact with.
- Torrent
- An abstract torrent, loaded from any backend that implements IntoTorrent.
- Torrent
File - A torrent file.
- TorrentID
- An infohash string truncated to 40 characters.
- Torrent
List - A list of
Torrent
, with querying/filtering capabilities. - Tracker
- A centralized variant of a
Peersource
.
Enums§
- Info
Hash - A torrent’s infohash, represented by a stringy lowercase hexadecimal digest.
- Info
Hash Error - Error occurred during parsing a
InfoHash
. - Magnet
Link Error - Error occurred during parsing a
MagnetLink
. - Multi
Target - Criteria to filter a
TorrentList
, returning multiple entries. - Peer
Source - A source of peers. Can be a
Tracker
or a decentralized source. - Torrent
File Error - Error occurred during parsing a
TorrentFile
. - Tracker
Error - Error occurred during parsing a
Tracker
. - Tracker
Scheme - A protocol used by a
Tracker
.
Traits§
- ToSingle
Target - Try to turn a stringy value into a
SingleTarget
. Fails if the value doesn’t look like aInfoHash
. - ToTorrent
- Turn a backend-specific torrent into an agnostic
Torrent
. - TryInfo
Hash - Try to turn a stringy value into an InfoHash. For user-submitted data that may or may not be actual infohash, use ToSingleTarget instead.
- TryInto
Tracker - Turn a backend-specific tracker struct into an agnostic
Tracker
.