Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/sebastianspeitel/ruestung
- Owner: SebastianSpeitel
- Created: 2024-06-14T05:56:37.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-19T11:56:02.000Z (5 months ago)
- Last Synced: 2024-06-19T21:50:08.541Z (5 months ago)
- Topics: builder, crate, library, rest-api, rust
- Language: Rust
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)