#![warn(missing_docs, unreachable_pub)]
#![deny(unsafe_code)]
#![deny(clippy::all)]
#![warn(clippy::pedantic)]
#![allow(clippy::module_name_repetitions)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
pub mod api;
pub mod client;
pub mod crypto;
pub mod custom;
mod deserialize;
pub mod earning;
pub mod economic_indicator;
pub mod error;
pub mod exchange;
pub mod forex;
pub mod quote;
pub mod search;
pub mod stock_time;
pub mod technical_indicator;
pub mod vec_trait;
pub use self::api::ApiClient;
use self::client::HttpClient;
#[must_use]
pub fn set_api<S, T>(api: S, client: T) -> ApiClient
where
S: Into<String>,
T: HttpClient + 'static + Send + Sync,
{
ApiClient::set_api(api, client)
}
#[must_use]
pub fn set_rapid_api<S, T>(api: S, client: T) -> ApiClient
where
S: Into<String>,
T: HttpClient + 'static + Send + Sync,
{
ApiClient::set_rapid_api(api, client)
}
macro_rules! json_data_struct {
($output:ident, $helper:ident) => {
pub async fn json(&self) -> Result<$output> {
let url = self.create_url();
let helper: $helper = self.api_client.get_json(&url).await?;
helper.convert()
}
};
}
pub(crate) use json_data_struct;