#[cfg(feature = "python")]
mod app;
#[cfg(feature = "python")]
mod client;
#[cfg(feature = "python")]
mod response;
#[cfg(feature = "python")]
pub use client::{
HypertorError, TorBootstrapError, TorConnectionError, TorTimeoutError, to_py_err,
};
#[cfg(feature = "python")]
use pyo3::prelude::*;
#[cfg(feature = "python")]
#[pymodule]
fn _hypertor(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add("__version__", crate::VERSION)?;
m.add_class::<client::PyClient>()?;
m.add_class::<client::PyAsyncClient>()?;
m.add_class::<response::PyResponse>()?;
m.add_class::<app::PyOnionApp>()?;
m.add_class::<app::PyAppConfig>()?;
m.add_class::<app::PyRequest>()?;
m.add_class::<app::PyAppResponse>()?;
m.add("HypertorError", m.py().get_type::<client::HypertorError>())?;
m.add(
"TorBootstrapError",
m.py().get_type::<client::TorBootstrapError>(),
)?;
m.add(
"ConnectionError",
m.py().get_type::<client::TorConnectionError>(),
)?;
m.add("TimeoutError", m.py().get_type::<client::TorTimeoutError>())?;
Ok(())
}