1#![doc = include_str!("../README.md")]
2#![forbid(unsafe_code)]
3#![cfg_attr(
4 not(any(feature = "multi-thread", feature = "tokio-multi-thread")),
5 allow(clippy::await_holding_refcell_ref)
6)]
7#![cfg_attr(docsrs, feature(doc_cfg))]
8
9#[macro_use]
10pub(crate) mod macros;
11
12pub mod constants;
13#[macro_use]
14pub mod http_client;
15pub mod v5;
16
17cfg_utils! {
18 pub mod utils;
19}
20
21pub use constants::*;
22pub use http_client::{HttpClient, HttpClientRef};
23use reqwest::{
24 header::{HeaderMap, HeaderValue, USER_AGENT},
25 Client,
26};
27pub use v5::MangaDexClient;
28
29pub(crate) fn get_default_client_api() -> Client {
30 let mut headers = HeaderMap::new();
31 headers.append(
32 USER_AGENT,
33 HeaderValue::from_static("mangadex-api-rs 3.2.0"),
34 );
35 Client::builder().default_headers(headers).build().unwrap()
36}