Skip to content

Commit bcf7f69

Browse files
committed
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
2 parents a1a8491 + f78638a commit bcf7f69

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

packages/primitives/src/lib.rs

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,47 @@
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.
17
use serde::{Deserialize, Serialize};
28

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.
417
#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, derive_more::Display, Clone)]
518
pub enum DatabaseDriver {
19+
// TODO: Move to the database crate once that gets its own crate.
20+
/// The Sqlite3 database driver.
621
Sqlite3,
22+
/// The MySQL database driver.
723
MySQL,
824
}
925

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.
1030
#[derive(Serialize, Deserialize, Copy, Clone, PartialEq, Eq, Debug)]
1131
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.
1333
#[serde(rename = "public")]
1434
Public,
1535

16-
// Will only track whitelisted info hashes.
36+
/// Will only track whitelisted info hashes.
1737
#[serde(rename = "listed")]
1838
Listed,
1939

20-
// Will only serve authenticated peers
40+
/// Will only serve authenticated peers
2141
#[serde(rename = "private")]
2242
Private,
2343

24-
// Will only track whitelisted info hashes and serve authenticated peers
44+
/// Will only track whitelisted info hashes and serve authenticated peers
2545
#[serde(rename = "private_listed")]
2646
PrivateListed,
2747
}

0 commit comments

Comments
 (0)