eagle_api/
lib.rs

1#![doc = include_str!("../README.md")]
2#![deny(unreachable_pub)]
3#![deny(clippy::unwrap_used)]
4#![deny(clippy::unwrap_in_result)]
5
6pub mod api;
7pub mod data;
8mod error;
9mod utils;
10
11pub use api::*;
12pub use error::*;
13
14use std::sync::Arc;
15
16use reqwest::Client;
17
18#[derive(Debug, Clone)]
19pub struct EagleApi {
20    inner: Arc<EagleInner>,
21}
22
23#[derive(Debug)]
24struct EagleInner {
25    host: String,
26    client: Client,
27}
28
29impl EagleApi {
30    pub fn new(host: &str) -> Self {
31        EagleApi {
32            inner: Arc::new(EagleInner {
33                host: host.trim_end_matches('/').to_string(),
34                client: Client::new(),
35            }),
36        }
37    }
38}