| Crates.io | splatoon3-rs |
| lib.rs | splatoon3-rs |
| version | 0.1.2 |
| created_at | 2024-10-06 07:17:18.057173+00 |
| updated_at | 2024-12-04 14:32:25.961053+00 |
| description | スプラトゥーン3のステージ情報を取得するクレートです |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1398856 |
| size | 12,572 |
A Rust library for accessing Splatoon 3 stage rotation information.
Add this to your Cargo.toml
[dependencies]
splatoon3-rs = "0.1.2"
tokio = { version = "1.0", features = ["full"] }
use splatoon3_rs::client::SplaClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create a new client
let client = SplaClient::new()?;
// Get current Regular Battle stages
let regular_stages = client.get_now_regular_open_stages().await?;
// Get upcoming Bankara Open stages
let bankara_open_stages = client.get_next_bankara_open_stages().await?;
// Get Bankara Challenge schedule
let bankara_challenge_stages = client.get_bankara_challenge_schedule().await?;
// Get X Battle schedule
let x_battle_stages = client.get_x_schedule().await?;
Ok(())
}
SplaClientnew()Creates a new instance of the SplaClient.
get_now_regular_open_stages()Returns the current Regular Battle stages.
get_next_bankara_open_stages()Returns the upcoming Bankara Open stages.
get_bankara_challenge_schedule()Returns the Bankara Challenge schedule.
get_x_schedule()Returns the X Battle schedule.
All methods return Result<Vec<Schedule>, Box<dyn std::error::Error>> where Schedule contains:
stages: Vector of stage information (id and name)start_time: Schedule start timeend_time: Schedule end timeThe library uses Rust's standard error handling with Result types. All API methods will return errors in cases such as:
To run tests:
cargo test
MIT
Contributions are welcome! Please feel free to submit a Pull Request.