#![cfg_attr(docsrs, feature(doc_cfg))]
#![warn(missing_docs)]
#![deny(rustdoc::broken_intra_doc_links)]
#![doc(
html_logo_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg"
)]
#![doc(
html_favicon_url = "https://github.com/compio-rs/compio-logo/raw/refs/heads/master/generated/colored-bold.svg"
)]
pub use quinn_proto::{
AckFrequencyConfig, ApplicationClose, Chunk, ClientConfig, ClosedStream, ConfigError,
ConnectError, ConnectionClose, ConnectionStats, EndpointConfig, IdleTimeout,
MtuDiscoveryConfig, ServerConfig, StreamId, Transmit, TransportConfig, VarInt, congestion,
crypto,
};
#[cfg(rustls)]
mod builder;
mod connection;
mod endpoint;
mod incoming;
mod recv_stream;
mod send_stream;
mod socket;
#[cfg(rustls)]
pub use builder::{ClientBuilder, ServerBuilder};
pub use connection::{Connecting, Connection, ConnectionError, OpenStreamError, SendDatagramError};
pub use endpoint::Endpoint;
pub use incoming::{Incoming, IncomingFuture};
pub use recv_stream::{ReadError, ReadExactError, RecvStream};
pub use send_stream::{SendStream, WriteError};
#[cfg(feature = "sync")]
pub(crate) use synchrony::sync;
#[cfg(not(feature = "sync"))]
pub(crate) use synchrony::unsync as sync;
pub(crate) use crate::{
connection::{ConnectionEvent, ConnectionInner},
endpoint::EndpointRef,
socket::*,
};
#[derive(Debug, thiserror::Error, Clone, PartialEq, Eq)]
pub enum StoppedError {
#[error("connection lost")]
ConnectionLost(#[from] ConnectionError),
#[error("0-RTT rejected")]
ZeroRttRejected,
}
impl From<StoppedError> for std::io::Error {
fn from(x: StoppedError) -> Self {
use StoppedError::*;
let kind = match x {
ZeroRttRejected => std::io::ErrorKind::ConnectionReset,
ConnectionLost(_) => std::io::ErrorKind::NotConnected,
};
Self::new(kind, x)
}
}
#[cfg(feature = "h3")]
pub mod h3 {
pub use h3::*;
pub use crate::{
connection::h3_impl::{BidiStream, OpenStreams},
send_stream::h3_impl::SendStream,
};
}