rust-cnb

Crates.iorust-cnb
lib.rsrust-cnb
version0.1.0
created_at2025-08-30 15:55:55.644618+00
updated_at2025-08-30 15:55:55.644618+00
descriptionrust-cnb with Generated API client
homepagehttps://cnb.cool/aodoo/rust-cnb
repositoryhttps://cnb.cool/aodoo/rust-cnb.git
max_upload_size
id1817729
size581,818
AaronMegs (AaronMegs)

documentation

README

rust-cnb

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(())
}

API 文档

此 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

Commit count: 0

cargo fmt