项目作者: two-mountains

项目描述 :
NetEase Cloud Music API for Rust
高级语言: Rust
项目地址: git://github.com/two-mountains/ncmapi-rs.git
创建时间: 2021-07-05T07:26:23Z
项目社区:https://github.com/two-mountains/ncmapi-rs

开源协议:MIT License

下载


ncmapi-rs

NetEase Cloud Music API for Rust.

Usage

  1. [dependencies]
  2. ncmapi = "0.1"
  3. tokio = { version = "1", features = ["full"] }
  1. use ncmapi::NcmApi;
  2. #[tokio::main]
  3. async fn main() -> std::result::Result<(), Box<dyn std::error:Error>> {
  4. let api = NcmApi::default();
  5. let resp = api.cloud_search("mota", None).await;
  6. let res = resp.unwrap().deserialize_to_implict();
  7. println!("{:#?}", res);
  8. Ok(())
  9. }

Document

Most of the functions are self documented. If there is some confusion about the params of a funtion requires, figure out here

How it works

  • api: export api functions.
  • client:
    • takes an ApiRequst, process it into a Request by presenting it with header and encrypt the payload etc. And then send requests to the server, takes the response and then returns the ApiResponse back.
    • cache

Contribute

If you think this package useful, please do make pull requests.

License

MIT