bloodbath-rust

This is a Rust implementation of the Bloodbath event scheduling library. This library is to be moved here.

Getting Started

To use this library in your Rust project, add the following to your Cargo.toml file:

toml [dependencies] bloodbath-rust = { git = "https://github.com/avosa/bloodbath-rust.git" }

Usage

Here's a basic example of how to use the bloodbath-rust library:

```rust //[yourprojectname]/src/main.rs

use bloodbath_rust::{Bloodbath, Event}; use std::sync::Arc;

[tokio::main]

async fn main() { // Create a Bloodbath instance with your API key let bloodbath = Arc::new(Bloodbath::new("yourapikey"));

// Schedule an event
let args = "time=2023-04-27T12:00:00Z;name=ExampleEvent";
let result = Event::schedule(&bloodbath, args).await;

match result {
    Ok(event) => {
        println!("Event scheduled successfully:");
        println!("ID: {}", event.id);
        println!("Name: {}", event.name);
        println!("Timestamp: {}", event.timestamp);
    },
    Err(e) => eprintln!("Error scheduling event: {:?}", e),
}

} ```

Replace "yourapikey" with your Bloodbath API key.

IMPORTANT: When you specify a dependency using a Git repository URL, Cargo will only clone the repository and not install its dependencies. Therefore, you will still need to specify the dependencies of the package being used separately in your project's Cargo.toml file.

In the case of the bloodbath-rust package, its dependencies are specified in its own Cargo.toml file, but if you want to use it in your project, you'll need to add those dependencies to your project's Cargo.toml file. For that case, add to your Cargo.toml file:

toml [dependencies] bloodbath-rust = { git = "https://github.com/avosa/bloodbath-rust.git" } tokio = { version = "1", features = ["full"] }

API

Bloodbath

Event

License

bloodbath-rust is released under the MIT License.