#![allow(unexpected_cfgs)]
use s2n_quic_core::application::ServerName;
#[cfg(test)]
#[global_allocator]
static ALLOCATOR: checkers::Allocator = checkers::Allocator::system();
#[cfg(s2n_quic_enable_pq_tls)]
static DEFAULT_POLICY: &s2n_tls::security::Policy = &s2n_tls::security::TESTING_PQ;
#[cfg(not(s2n_quic_enable_pq_tls))]
static DEFAULT_POLICY: &s2n_tls::security::Policy = &s2n_tls::security::DEFAULT_TLS13;
#[non_exhaustive]
pub struct ConnectionContext<'a> {
pub server_name: Option<&'a ServerName>,
}
pub trait ConfigLoader: 'static + Send {
fn load(&mut self, cx: ConnectionContext) -> config::Config;
}
impl ConfigLoader for config::Config {
#[inline]
fn load(&mut self, _cx: ConnectionContext) -> config::Config {
self.clone()
}
}
impl<T: FnMut(ConnectionContext) -> config::Config + Send + 'static> ConfigLoader for T {
#[inline]
fn load(&mut self, cx: ConnectionContext) -> config::Config {
(self)(cx)
}
}
impl ConfigLoader for Box<dyn ConfigLoader> {
#[inline]
fn load(&mut self, cx: ConnectionContext) -> config::Config {
(**self).load(cx)
}
}
mod callback;
mod keylog;
mod params;
mod session;
pub mod certificate;
pub mod client;
pub mod server;
pub use client::Client;
pub use s2n_tls::*;
pub use server::Server;
#[cfg(test)]
mod tests;