-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #290: Crate docs for
primitives
package
f78638a docs: [#279] crate docs for locate-error package (Jose Celano) Pull request description: Documentation for the `primitives` package (`./package/primitives`). Top commit has no ACKs. Tree-SHA512: 1daff76f3acdc41df21916232c785c60a359a556867a03fe363377b9880cfd13c3668d7ec192b5fa698e4c5da83eb9c85c7decf086c7322c928ab20716ddfe7a
- Loading branch information
Showing
1 changed file
with
25 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,47 @@ | ||
//! Primitive types for [Torrust Tracker](https://docs.rs/torrust-tracker). | ||
//! | ||
//! This module contains the basic data structures for the [Torrust Tracker](https://docs.rs/torrust-tracker), | ||
//! which is a `BitTorrent` tracker server. These structures are used not only | ||
//! by the tracker server crate, but also by other crates in the Torrust | ||
//! ecosystem. | ||
use serde::{Deserialize, Serialize}; | ||
|
||
// TODO: Move to the database crate once that gets its own crate. | ||
/// The database management system used by the tracker. | ||
/// | ||
/// Refer to: | ||
/// | ||
/// - [Torrust Tracker Configuration](https://docs.rs/torrust-tracker-configuration). | ||
/// - [Torrust Tracker](https://docs.rs/torrust-tracker). | ||
/// | ||
/// For more information about persistence. | ||
#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, derive_more::Display, Clone)] | ||
pub enum DatabaseDriver { | ||
// TODO: Move to the database crate once that gets its own crate. | ||
/// The Sqlite3 database driver. | ||
Sqlite3, | ||
/// The MySQL database driver. | ||
MySQL, | ||
} | ||
|
||
/// The mode the tracker will run in. | ||
/// | ||
/// Refer to [Torrust Tracker Configuration](https://docs.rs/torrust-tracker-configuration) | ||
/// to know how to configure the tracker to run in each mode. | ||
#[derive(Serialize, Deserialize, Copy, Clone, PartialEq, Eq, Debug)] | ||
pub enum TrackerMode { | ||
// Will track every new info hash and serve every peer. | ||
/// Will track every new info hash and serve every peer. | ||
#[serde(rename = "public")] | ||
Public, | ||
|
||
// Will only track whitelisted info hashes. | ||
/// Will only track whitelisted info hashes. | ||
#[serde(rename = "listed")] | ||
Listed, | ||
|
||
// Will only serve authenticated peers | ||
/// Will only serve authenticated peers | ||
#[serde(rename = "private")] | ||
Private, | ||
|
||
// Will only track whitelisted info hashes and serve authenticated peers | ||
/// Will only track whitelisted info hashes and serve authenticated peers | ||
#[serde(rename = "private_listed")] | ||
PrivateListed, | ||
} |