1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//! ## Feature flags
#![doc = document_features::document_features!()]

#![warn(clippy::pedantic)]

#[macro_use]
extern crate tracing;

pub mod domain;
pub mod message;

#[derive(Debug, thiserror::Error, miette::Diagnostic)]
pub enum Error {
    #[error("request channel closed")]
    RequestChannelClosed,
    #[error("response channel closed")]
    ResponseChannelClosed,
    #[error("transport io error: {0}")]
    TransportIo(#[from] std::io::Error),
    #[error("api error: {0:?}")]
    ApiError(message::response::ErrMsgMsg),
}

#[cfg(feature = "async")]
mod async_client;
#[cfg(feature = "async")]
pub use async_client::{SpawnTask, AsyncClient};