use std::{io, sync::Arc};
use futures::future::BoxFuture;
use tokio::net::TcpStream;
mod builder;
mod codec_config;
mod config;
mod connect_parts;
mod error;
mod hooks;
mod messaging;
#[cfg(feature = "pool")]
mod pool;
mod preamble_builder;
mod preamble_exchange;
mod response_stream;
mod runtime;
mod send_streaming;
mod socket_option_methods;
mod streaming;
mod streaming_helpers;
mod tracing_config;
mod tracing_helpers;
pub use builder::WireframeClientBuilder;
pub use codec_config::ClientCodecConfig;
pub use config::SocketOptions;
pub use error::{ClientError, ClientProtocolError, ClientWireframeError};
pub use hooks::{
AfterReceiveHook,
BeforeSendHook,
ClientConnectionSetupHandler,
ClientConnectionTeardownHandler,
ClientErrorHandler,
};
#[cfg(feature = "pool")]
pub use pool::{
ClientPoolConfig,
PoolFairnessPolicy,
PoolHandle,
PooledClientLease,
WireframeClientPool,
};
pub use response_stream::ResponseStream;
pub use runtime::WireframeClient;
pub use send_streaming::{SendStreamingConfig, SendStreamingOutcome};
pub use streaming_helpers::{StreamingResponseExt, TypedResponseStream};
pub use tracing_config::TracingConfig;
pub type ClientPreambleSuccessHandler<T> = Arc<
dyn for<'a> Fn(&'a T, &'a mut TcpStream) -> BoxFuture<'a, io::Result<Vec<u8>>>
+ Send
+ Sync
+ 'static,
>;
pub type ClientPreambleFailureHandler = Arc<
dyn for<'a> Fn(&'a ClientError, &'a mut TcpStream) -> BoxFuture<'a, io::Result<()>>
+ Send
+ Sync
+ 'static,
>;
#[cfg(test)]
mod tests;