use std::{
io,
ops::{Deref, DerefMut},
};
pub struct Config {
#[allow(unused)]
pub(crate) udp_data_channel_len: usize,
#[allow(unused)]
pub(crate) stream_buffer: usize,
quiche_config: quiche::Config,
}
impl Config {
pub fn new() -> io::Result<Self> {
Ok(Self {
udp_data_channel_len: 1024,
stream_buffer: 1024,
quiche_config: quiche::Config::new(quiche::PROTOCOL_VERSION)
.map_err(|err| io::Error::new(io::ErrorKind::Other, err))?,
})
}
}
impl Deref for Config {
type Target = quiche::Config;
fn deref(&self) -> &Self::Target {
&self.quiche_config
}
}
impl DerefMut for Config {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.quiche_config
}
}