muxtls 0.5.0

Multiplexed streams over TLS/TCP
Documentation
#![forbid(unsafe_code)]

//! `muxtls` provides multiplexed bidirectional streams over TLS/TCP.
//!
//! Use [`Endpoint`] to connect or accept, then [`Connection::open_bi`] or
//! [`Connection::accept_bi`] to obtain independent send and receive halves.
//! Keep a connection handle alive until its streams have finished.
//!
//! # Example
//!
//! ```rust,no_run
//! use muxtls::{ClientConfig, Endpoint};
//! use std::net::SocketAddr;
//!
//! # #[tokio::main(flavor = "current_thread")]
//! # async fn main() -> muxtls::Result<()> {
//! let endpoint = Endpoint::client(ClientConfig::with_native_roots()?);
//! let addr: SocketAddr = SocketAddr::from(([127, 0, 0, 1], 4433));
//! let conn = endpoint.connect(addr, "localhost")?.await?;
//! let (send, recv) = conn.open_bi().await?;
//! let _ = (send, recv);
//! # Ok(())
//! # }
//! ```

mod config;
mod connection;
mod endpoint;
mod error;
mod flow;
mod limits;
mod stream;

pub use config::{ClientConfig, ServerConfig};
pub use connection::{Connection, ConnectionStats, PeerIdentity};
pub use endpoint::{Connecting, Endpoint};
pub use error::{Error, Result};
pub use limits::Limits;
pub use stream::{RecvStream, SendStream};

#[cfg(feature = "fuzzing")]
#[doc(hidden)]
pub use connection::fuzz_connection_state;