1 unstable release

0.1.0-pre.0 Feb 28, 2023

#9 in #oxide

MIT license

23KB
386 lines

Oxide Todo SDK

A asynchronous SDK (Software Development Kit) for oxide_todo written in Rust. It provides a simple API to interact with the server.

MSRV (Minimum Supported Rust Version)

The minimum supported Rust version is 1.64.0. (Recommended during development)

Usage

Add this to your Cargo.toml:

[dependencies]
oxide_todo_sdk = "0.1.0"

Examples

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.

Features

  • Authentication
    • Register
    • Login
    • Revoke Token
  • Todos
    • Create Todo
    • Get Todo
    • Update Todo
    • Delete Todo
    • List Todos (including search)
    • Delete All Todos
  • [Server Metadata]
    • Get Server Metadata

Contributing

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.

Code of Conduct

This project adheres to the Rust Code of Conduct. By participating, you are expected to uphold this code.

License

This project is licensed under the terms of the MIT license. See LICENSE for more information.

Dependencies

~5–18MB
~272K SLoC