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
//! Async implementation of Discord Rich Presence client
//!
//! This module provides a runtime-agnostic async implementation of the Discord IPC client
//! that works with any async runtime through the use of abstract traits.
//!
//! ## Unified API (Recommended)
//!
//! The library provides a single `AsyncDiscordIpcClient` type that automatically adapts
//! to your chosen async runtime. Simply enable the appropriate feature flag:
//!
//! - `tokio-runtime` - for Tokio
//! - `async-std-runtime` - for async-std
//! - `smol-runtime` - for smol
//!
//! ### Example
//!
//! ```rust,no_run
//! # #[cfg(any(feature = "tokio-runtime", feature = "async-std-runtime", feature = "smol-runtime"))]
//! # {
//! // Same code works with any runtime!
//! use presenceforge::{AsyncDiscordIpcClient, ActivityBuilder, Result};
//!
//! async fn setup_presence() -> Result {
//! let mut client = AsyncDiscordIpcClient::new("your_client_id").await?;
//! client.connect().await?;
//!
//! let activity = ActivityBuilder::new()
//! .state("Playing a game")
//! .details("In the menu")
//! .build();
//!
//! client.set_activity(&activity).await?;
//! Ok(())
//! }
//! # }
//! ```
//!
//! ## Runtime-Specific APIs (Advanced)
//!
//! For advanced use cases where you need direct access to runtime-specific features,
//! you can still import the concrete types:
//!
//! ### With Tokio
//!
//! ```rust,no_run
//! # #[cfg(feature = "tokio-runtime")]
//! use presenceforge::async_io::tokio::TokioDiscordIpcClient;
//! ```
//!
//! ### With async-std
//!
//! ```rust,no_run
//! # #[cfg(feature = "async-std-runtime")]
//! use presenceforge::async_io::async_std::AsyncStdDiscordIpcClient;
//! ```
//!
//! ### With smol
//!
//! ```rust,no_run
//! # #[cfg(feature = "smol-runtime")]
//! use presenceforge::async_io::smol::SmolDiscordIpcClient;
//! ```
pub use AsyncDiscordIpcClient;
pub use ;
// Runtime-specific re-exports