Crates.io | oxide_todo_sdk |
lib.rs | oxide_todo_sdk |
version | 0.1.0-pre.0 |
source | src |
created_at | 2023-02-28 12:13:55.959467 |
updated_at | 2023-02-28 12:13:55.959467 |
description | Rust SDK for the Oxide Todo API |
homepage | |
repository | https://github.com/TheAwiteb/oxide_todo_sdk |
max_upload_size | |
id | 796979 |
size | 52,568 |
A asynchronous SDK (Software Development Kit) for oxide_todo written in Rust. It provides a simple API to interact with the server.
The minimum supported Rust version is 1.64.0. (Recommended during development)
Add this to your Cargo.toml
:
[dependencies]
oxide_todo_sdk = "0.1.0"
This example shows how to create a new todo:
use oxide_todo_sdk::types::TodoStatus;
use oxide_todo_sdk::Client;
use oxide_todo_sdk::errors::Result as OxideTodoResult;
#[tokio::main]
async fn main() -> OxideTodoResult<()> {
let todo = Client::new("http://localhost:8080")
.login("username", "password")
.await? // Type: oxide_todo_sdk::types::User
.create_todo("title") // Type: oxide_todo_sdk::types::Todo
.set_status(TodoStatus::Completed) // Type: oxide_todo_sdk::types::Todo
.await?; // Type: oxide_todo_sdk::types::Todo
println!("Todo created: {todo:?}");
// ^ This need `debug` feature
Ok(())
}
As you can see above, the SDK is flexible and you can await the Todo type directly.
Check out the documentation for more information. Also check out the examples for more examples.
If you want to contribute to this project, feel free to open a pull request. If you want to add a new feature, please open an issue first. If you have any questions, feel free to open an issue.
This project adheres to the Rust Code of Conduct. By participating, you are expected to uphold this code.
This project is licensed under the terms of the MIT license. See LICENSE for more information.