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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// For serde_json
//! # Qbittorrent Web API wrapper
//!
//! This module provides a wrapper around the Qbit Web API, enabling
//! interaction with the API through a structured and type-safe interface.
//!
//! The wrapper includes functionality for managing authentication states,
//! handling credentials, and interacting with various API endpoints.
//!
//! The library is designed to support Qbittorrent version `5.1`
//!
//! # Example
//!
//! Basic usage to get all torrents
//! ```no_run
//! use qbit::{Api, Credentials};
//!
//! #[tokio::main]
//! async fn main() {
//! let credentials = Credentials::Login("username".to_string(), "password".to_string());
//! let client = Api::new_login("http://qBittorrent.server:6969", credentials)
//! .await
//! .unwrap();
//!
//! let torrents = client.torrents(None).await.unwrap();
//!
//! for torrent in torrents {
//! println!("{:?}", torrent);
//! }
//! }
//! ```
//!
pub
/// Data object models.
/// Parameter objects.
pub use Api;
pub use Error;
compile_error!;
/// Login state
///
/// Represents the authentication state of a user in the system.
/// Represents the credentials used for authentication.
///
/// This enum holds the credentials for either a username:password or API key authentication.