mod connections;
mod connector;
mod listener;
mod psk;
mod stream;
use self::{
super::{SyncConnector, SyncListener, SyncStream},
stream::QuicStream,
};
pub(crate) use self::{
connections::ConnectionPool,
connector::QuicConnector,
listener::QuicListener,
psk::{PskSeed, PskStore},
};
const ALPN_QUIC_SYNC: &[u8] = b"quic-sync-unstable";
#[derive(Debug, thiserror::Error)]
pub(crate) enum Error {
#[error(transparent)]
QuicConnection(#[from] s2n_quic::connection::Error),
#[error(transparent)]
QuicStream(#[from] s2n_quic::stream::Error),
#[error("could not start QUIC client")]
ClientStart(#[source] s2n_quic::provider::StartError),
#[error("could not start QUIC server")]
ServerStart(#[source] s2n_quic::provider::StartError),
#[error(transparent)]
Send(s2n_quic::stream::Error),
#[error(transparent)]
Receive(std::io::Error),
#[error(transparent)]
Finish(s2n_quic::stream::Error),
#[error("message exceeds buffer capacity")]
MessageTooLarge,
#[error(transparent)]
Bug(#[from] buggy::Bug),
#[error(transparent)]
Other(#[from] anyhow::Error),
}
impl From<std::convert::Infallible> for Error {
fn from(err: std::convert::Infallible) -> Self {
match err {}
}
}