1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! Common utilities and shared functionality.
//!
//! This module contains helper functions and data structures used across
//! all other modules in the tracker codebase.
//!
//! # Utilities
//!
//! - Query string parsing
//! - Hex encoding/decoding
//! - IP address validation
//! - Logging setup
//! - Timestamp utilities
//! - Graceful shutdown handling
//!
//! # Data Structures
//!
//! - `CustomError` - Custom error type
//! - `NumberOfBytes` - Byte count wrapper
//! - `GetTorrentsApi` - API request struct
//!
//! # Example
//!
//! ```rust,ignore
//! use torrust_actix::common::common::{parse_query, hex2bin, current_time};
//!
//! // Parse query string
//! let params = parse_query("info_hash=%ab%cd...&peer_id=%12%34...");
//!
//! // Convert hex string to bytes
//! let bytes = hex2bin("abcd1234...")?;
//!
//! // Get current timestamp
//! let now = current_time();
//! ```
/// Common data structures (errors, API requests, byte wrappers).
/// Core utility functions.
/// Implementation blocks for common types.