threexui_rs/lib.rs
1//! # threexui-rs
2//!
3//! Async Rust SDK for the [3x-ui](https://github.com/MHSanaei/3x-ui) panel API.
4//!
5//! This crate targets 3x-ui **v2.9.3**. The library version mirrors the panel version —
6//! `threexui-rs v2.9.3` is compatible with 3x-ui `v2.9.3`.
7//!
8//! ## Quick start
9//!
10//! ```rust,no_run
11//! use threexui_rs::{Client, ClientConfig};
12//!
13//! #[tokio::main]
14//! async fn main() -> threexui_rs::Result<()> {
15//! let config = ClientConfig::builder()
16//! .host("192.168.1.1")
17//! .port(2053)
18//! .build()?;
19//!
20//! let client = Client::new(config);
21//! client.login("admin", "admin123").await?;
22//!
23//! let inbounds = client.inbounds().list().await?;
24//! println!("Found {} inbounds", inbounds.len());
25//!
26//! client.logout().await?;
27//! Ok(())
28//! }
29//! ```
30
31pub mod api;
32pub mod client;
33pub mod config;
34pub mod error;
35pub mod models;
36
37pub use client::Client;
38pub use config::ClientConfig;
39pub use error::{Error, Result};
40
41// Inbound models
42pub use models::inbound::{ClientTraffic, Inbound, InboundClient, Protocol};
43
44// Server models
45pub use models::server::{
46 AppStats, CpuHistoryPoint, EchCert, Mldsa65Keys, Mlkem768Keys, NetIO, NetTraffic, PublicIP,
47 ResourceStat, ServerStatus, UuidResponse, VlessAuth, VlessEncResult, X25519Cert, XrayState,
48};
49
50// Settings
51pub use models::settings::AllSetting;
52
53// Xray models
54pub use models::xray::{NordAction, OutboundTraffic, WarpAction, XraySetting};
55
56// Custom geo models
57pub use models::custom_geo::{CreateCustomGeo, CustomGeoAliases, CustomGeoResource};