Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sebastianspeitel/ruestung

Typesafe REST client builder
https://github.com/sebastianspeitel/ruestung

builder crate library rest-api rust

Last synced: 1 day ago
JSON representation

Typesafe REST client builder

Awesome Lists containing this project

README

        

# Ruestung

Typesafe REST client builder.

## Example

```rust
use ruestung::prelude::*;

#[derive(Debug, serde::Deserialize)]
struct CatFact {
fact: String,
length: usize,
}

struct Fact;
impl Endpoint for Fact {
const URL: &'static str = "https://catfact.ninja/fact";
type Query = ();
type Response = CatFact;
}

#[tokio::main]
async fn main() {
let api = Api::::new();

let fact = api.into_future().await.unwrap();

dbg!(fact);
}
```

More complex examples can be found in the [`examples`](./examples) directory.

## TODOs

- [ ] More complex examples
- [ ] Implement IntoFuture
- [ ] Implement Stream for paginated endpoints

## Name

`Rust` + `REST` = `ruest` (already taken) => `ruestung` (german word for armor)