Skip to main content

Crate librqbit

Crate librqbit 

Source
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§

pub use api::Api;
pub use dht;

Modules§

api
file_info
http_api_client
http_api_types
limits
session_stats
spawn_utils
storage
Storage engine for torrent data.

Structs§

AddTorrentOptions
Options for adding new torrents to the session.
ApiError
AzureusStyle
ByteBuf
ByteBufOwned
ConnectionOptions
CreateTorrentOptions
CreateTorrentResult
DhtSessionConfig
Configuration for the DHT subsystem. Set to None in SessionOptions::dht to disable DHT entirely.
FileDetails
FileDetailsAttrs
FileDetailsExt
FileIteratorName
ListOnlyResponse
ListenerOptions
Magnet
A parsed magnet link.
ManagedTorrent
ManagedTorrentShared
Common information about torrent shared among all possible states.
ParsedTorrent
PeerConnectionOptions
Session
SessionOptions
TorrentMetaV1
A parsed .torrent file.
TorrentMetaV1File
TorrentMetaV1Info
Main torrent information, shared by .torrent files and magnet link contents.
TorrentMetadata
TorrentStats
ValidatedTorrentMetaV1Info

Enums§

AddTorrent
AddTorrentResponse
AzureusStyleKind
Error
FileIteratorNameData
ListenerMode
MagnetError
ManagedTorrentState
PeerId
SessionPersistenceConfig
TorrentStatsState

Constants§

SUPPORTED_SCHEMES

Traits§

ByteBufT
CloneToOwned
WithStatus
WithStatusError

Functions§

client_name_and_version
create_torrent
generate_azereus_style
Generate a client fingerprint in the Azereus format, where b"-xx1234-" corresponds to version 1.2.3.4`` of the torrent client abbreviated by xx`
generate_peer_id
Panics if the fingerprint slice 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.

Type Aliases§

FileInfos
Result
TorrentMetaV1Borrowed
TorrentMetaV1Owned