Giter Site home page Giter Site logo

sayobot_api_wrap's Introduction

Sayobot API Wrapper

这是一个用于封装 Sayobot API 的 Rust 库,旨在提供简单、高效的方式来访问 Sayobot 提供的 osu! 游戏数据。

特性

  • 异步支持:基于 tokioreqwest,提供完全的异步 API 调用。
  • 序列化/反序列化:利用 serde 和相关库,轻松处理 JSON 数据。
  • 错误处理:通过 anyhow 库,简化错误处理流程。

依赖

本项目依赖于以下主要的 crates:

  • tokio:异步运行时。
  • reqwest:异步 HTTP 客户端。
  • serdeserde_json:序列化和反序列化 JSON 数据。
  • anyhow:简化错误处理。

使用

首先,确保你的 Rust 版本是 2021 edition 或更高。然后,将此库作为依赖项添加到你的 Cargo.toml 文件中:

[dependencies]
sayobot_api_wrap = { git = "https://github.com/xlfish233/sayobot_api_wrap.git", branch = "main" }
use sayobot_api_wrap::beatmap_info_v2::BeatmapInfoV2;



#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
    let beatmap_info = BeatmapInfoV2::new(beatmap_id).await?;
    println!("{:?}", beatmap_info);
    Ok(())
}

sayobot_api_wrap's People

Contributors

xlfish233 avatar

Watchers

 avatar

sayobot_api_wrap's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.