5 个版本
| 0.1.4 | 2024年2月6日 | 
|---|---|
| 0.1.3 | 2023年10月6日 | 
| 0.1.2 | 2023年7月15日 | 
| 0.1.1 | 2023年6月23日 | 
| 0.1.0 | 2023年6月5日 | 
#4 在 #lol
每月55次 下载
用于  2 crates
29KB
483 行
Irelia
Irelia 是由 riot games 为 LoL 提供的本地 https API 的封装
[dependencies]
irelia = "0.7"
Cargo 特性
这个 crate 考虑到了模块化设计,因此 API 支持已被拆分为不同的 cargo 特性。
默认情况下,除了回放特性外,所有功能都已启用
- ["full"]- 启用对所有 API 的支持
- ["ws"]- 启用对 LCU websock ets 的支持
- ["in_game"]- 启用对本地游戏 API 的支持
- ["batched"]- 启用批处理请求系统
- ["replay"]- 启用回放 API 接口
向 LCU 发送请求
使用 irelia 向 LCU 发送请求很简单
use irelia::{Error, RequestClient, rest::LcuClient};
use serde_json::Value;
#[tokio::main]
async fn main() {
    let request_client = RequestClient::new();
    let lcu_client = LcuClient::new(false).unwrap();
    
    let json: Result<Option<Value>, Error> = lcu_client.get("/endpoint", &request_client).await;
}
示例
最新的示例总是可以在 这里 找到
lib.rs:
这个解码器大部分来自这篇文章。 https://dev.to/tiemen/implementing-base64-from-scratch-in-rust-kb1 它详细介绍了整个过程以及为什么它以这种方式工作,我强烈推荐阅读它!非常感谢 Tiemen 编写它!
使用 u64 作为字节数组的用法来自 base64 crate,该 crate 采用了 MIT 许可证