Expand description
This crate provides everything necessary to download torrents.
§Quick usage example
use librqbit::*;
tokio_test::block_on(async {
let session = Session::new("/tmp/where-to-download".into()).await.unwrap();
let managed_torrent_handle = session.add_torrent(
AddTorrent::from_url("magnet:?xt=urn:btih:cab507494d02ebb1178b38f2e9d7be299c86b862"),
None // options
).await.unwrap().into_handle().unwrap();
managed_torrent_handle.wait_until_completed().await.unwrap();
})§Overview
The main type to start off with is Session.
It also proved useful to use the Api when building the rqbit desktop app, as it provides
a facade that works with simple serializable types.
Re-exports§
Modules§
- api
- file_
info - http_
api_ client - http_
api_ types - limits
- session_
stats - spawn_
utils - storage
- Storage engine for torrent data.
Structs§
- AddTorrent
Options - Options for adding new torrents to the session.
- ApiError
- Azureus
Style - ByteBuf
- Byte
BufOwned - Connection
Options - Create
Torrent Options - Create
Torrent Result - DhtSession
Config - Configuration for the DHT subsystem.
Set to
NoneinSessionOptions::dhtto disable DHT entirely. - File
Details - File
Details Attrs - File
Details Ext - File
Iterator Name - List
Only Response - Listener
Options - Magnet
- A parsed magnet link.
- Managed
Torrent - Managed
Torrent Shared - Common information about torrent shared among all possible states.
- Parsed
Torrent - Peer
Connection Options - Session
- Session
Options - Torrent
Meta V1 - A parsed .torrent file.
- Torrent
Meta V1File - Torrent
Meta V1Info - Main torrent information, shared by .torrent files and magnet link contents.
- Torrent
Metadata - Torrent
Stats - Validated
Torrent Meta V1Info
Enums§
- AddTorrent
- AddTorrent
Response - Azureus
Style Kind - Error
- File
Iterator Name Data - Listener
Mode - Magnet
Error - Managed
Torrent State - PeerId
- Session
Persistence Config - Torrent
Stats State
Constants§
Traits§
Functions§
- client_
name_ and_ version - create_
torrent - generate_
azereus_ style - Generate a client fingerprint in the Azereus format, where
b"-xx1234-"corresponds to version1.2.3.4`` of the torrent client abbreviated byxx` - generate_
peer_ id - Panics if the
fingerprintslice isn’t eight bytes long - librqbit_
spawn - Spawns a future with tracing instrumentation.
- torrent_
from_ bytes - Parse torrent metainfo from bytes (includes info_hash).
- try_
decode_ peer_ id - try_
increase_ nofile_ limit - version
- The cargo version of librqbit.