1#![forbid(unsafe_code)]
2#![cfg_attr(docsrs, feature(doc_cfg))]
3#![doc = include_str!("../README.md")]
4
5pub use builder::Builder;
6pub use client::Client;
7pub(crate) use config::Config;
8
9mod builder;
10mod client;
11mod config;
12mod error;
13pub mod lang;
14
15pub mod types {
16 pub use super::error::{ErrorKind, ErrorResponse};
20}
21
22#[must_use]
24#[derive(Debug, thiserror::Error)]
25pub enum Error {
26 #[error("http error: {0}")]
28 Http(#[from] reqwest::Error),
29
30 #[cfg(feature = "streaming")]
32 #[cfg_attr(docsrs, doc(cfg(feature = "streaming")))]
33 #[error("websocket error: {0}")]
34 Ws(#[from] reqwest_websocket::Error),
35
36 #[error("api error: {0}")]
38 Api(#[from] types::ErrorResponse),
39}
40
41pub type Result<T, E = Error> = std::result::Result<T, E>;