api_builder 0.1.2

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
// Errors that can occur from HTTP clients.
#[derive(Debug, thiserror::Error)]
pub enum HttpClientError {
    /// There was an error with `reqwest`.
    #[cfg(feature = "reqwest")]
    #[error(transparent)]
    Reqwest(#[from] reqwest::Error),
    /// There was an error with `rquest`.
    /// There was an error with `gloo-net`.
    #[cfg(target_arch = "wasm32")]
    #[error(transparent)]
    GlooNet(#[from] gloo_net::Error),
    /// There was an unknown error from an unknown client.
    #[error(transparent)]
    Other(#[from] anyhow::Error),
}