|
| 1 | +//! Primitive types for [Torrust Tracker](https://docs.rs/torrust-tracker). |
| 2 | +//! |
| 3 | +//! This module contains the basic data structures for the [Torrust Tracker](https://docs.rs/torrust-tracker), |
| 4 | +//! which is a `BitTorrent` tracker server. These structures are used not only |
| 5 | +//! by the tracker server crate, but also by other crates in the Torrust |
| 6 | +//! ecosystem. |
1 | 7 | use serde::{Deserialize, Serialize}; |
2 | 8 |
|
3 | | -// TODO: Move to the database crate once that gets its own crate. |
| 9 | +/// The database management system used by the tracker. |
| 10 | +/// |
| 11 | +/// Refer to: |
| 12 | +/// |
| 13 | +/// - [Torrust Tracker Configuration](https://docs.rs/torrust-tracker-configuration). |
| 14 | +/// - [Torrust Tracker](https://docs.rs/torrust-tracker). |
| 15 | +/// |
| 16 | +/// For more information about persistence. |
4 | 17 | #[derive(Serialize, Deserialize, PartialEq, Eq, Debug, derive_more::Display, Clone)] |
5 | 18 | pub enum DatabaseDriver { |
| 19 | + // TODO: Move to the database crate once that gets its own crate. |
| 20 | + /// The Sqlite3 database driver. |
6 | 21 | Sqlite3, |
| 22 | + /// The MySQL database driver. |
7 | 23 | MySQL, |
8 | 24 | } |
9 | 25 |
|
| 26 | +/// The mode the tracker will run in. |
| 27 | +/// |
| 28 | +/// Refer to [Torrust Tracker Configuration](https://docs.rs/torrust-tracker-configuration) |
| 29 | +/// to know how to configure the tracker to run in each mode. |
10 | 30 | #[derive(Serialize, Deserialize, Copy, Clone, PartialEq, Eq, Debug)] |
11 | 31 | pub enum TrackerMode { |
12 | | - // Will track every new info hash and serve every peer. |
| 32 | + /// Will track every new info hash and serve every peer. |
13 | 33 | #[serde(rename = "public")] |
14 | 34 | Public, |
15 | 35 |
|
16 | | - // Will only track whitelisted info hashes. |
| 36 | + /// Will only track whitelisted info hashes. |
17 | 37 | #[serde(rename = "listed")] |
18 | 38 | Listed, |
19 | 39 |
|
20 | | - // Will only serve authenticated peers |
| 40 | + /// Will only serve authenticated peers |
21 | 41 | #[serde(rename = "private")] |
22 | 42 | Private, |
23 | 43 |
|
24 | | - // Will only track whitelisted info hashes and serve authenticated peers |
| 44 | + /// Will only track whitelisted info hashes and serve authenticated peers |
25 | 45 | #[serde(rename = "private_listed")] |
26 | 46 | PrivateListed, |
27 | 47 | } |
0 commit comments