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
//! # league-link
//!
//! An async Rust client for the League of Legends Client (LCU) API.
//!
//! `league-link` provides three primitives:
//!
//! 1. **Credential discovery** — [`authenticate`] / [`try_find_lcu`] /
//! [`try_find_lcu_async`] / [`try_find_lcu_via_lockfile`] locate a running
//! client and extract its local API port and auth token.
//! 2. **HTTP requests** — [`build_lcu_client`] + [`lcu_get`] / [`lcu_post`]
//! / [`lcu_delete`] issue typed requests against the local HTTPS server.
//! 3. **WebSocket events** — [`ws_connect`] or [`ws_connect_filtered`]
//! subscribe to LCU events and deliver them through an [`EventStream`].
//!
//! ## Example
//!
//! ```no_run
//! use league_link::{authenticate, build_lcu_client, lcu_get, ws_connect};
//! use serde_json::Value;
//!
//! # async fn run() -> Result<(), league_link::LcuError> {
//! // 1. Find the running client
//! let creds = authenticate(1000, 30).await?;
//!
//! // 2. Make an HTTP call
//! let client = build_lcu_client()?;
//! let me: Value = lcu_get(&client, &creds, "/lol-summoner/v1/current-summoner").await?;
//! println!("summoner: {me}");
//!
//! // 3. Watch live events
//! let mut stream = ws_connect(&creds, 128).await?;
//! while let Some(event) = stream.recv().await {
//! println!("[{:?}] {}", event.event_type, event.uri);
//! }
//! # Ok(()) }
//! ```
/// Unified error type returned by every fallible operation in this crate.
pub use ;
pub use LcuError;
pub use ;
pub use ;