api_builder 0.2.0

A simple client-agnostic API builder, inspired by the GitLab crate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use api_builder::{ReqwestAsyncClient, RestClient, api_rest_client};

/// Any client errors.
#[derive(Debug, thiserror::Error)]
pub enum APIError {}

/// The main client.
#[derive(ReqwestAsyncClient)]
pub struct Client {
    /// Inner reqwest client.
    async_client: reqwest::Client,
}
#[api_rest_client(error = APIError, base = "\"https://example.com/v1/\"")]
impl RestClient for Client {}

fn main() {}