Crates.io | rust-cnb |
lib.rs | rust-cnb |
version | 0.1.0 |
created_at | 2025-08-30 15:55:55.644618+00 |
updated_at | 2025-08-30 15:55:55.644618+00 |
description | rust-cnb with Generated API client |
homepage | https://cnb.cool/aodoo/rust-cnb |
repository | https://cnb.cool/aodoo/rust-cnb.git |
max_upload_size | |
id | 1817729 |
size | 581,818 |
API client generated from Swagger specification
将以下内容添加到你的 Cargo.toml
文件中:
[dependencies]
rust-cnb = "1.0"
reqwest = { version = "0.11", features = ["json"] }
tokio = { version = "1", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
use rust-cnb::client::ApiClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = ApiClient::new("https://localhost".to_string());
// 示例调用
Ok(())
}
此 SDK 基于 CNB OPENAPI API 生成。
API 版本: 1.0
该 API 不需要认证。
所有 API 调用都返回 Result<T, ApiError>
,其中 ApiError
包含以下类型:
ApiError::RequestError
- HTTP 请求错误ApiError::HttpError
- HTTP 状态码错误ApiError::UrlError
- URL 解析错误ApiError::JsonError
- JSON 序列化/反序列化错误欢迎提交 Issue 和 Pull Request。
MIT License