pub use http3::{ext::Protocol, PseudoId, PseudoOrder, PseudoOrderBuilder, SettingId};
pub(crate) mod client;
#[cfg(feature = "http3-datagram")]
pub(crate) mod datagram;
pub(crate) mod dispatch;
pub(crate) mod transport;
pub(crate) mod upgrade;
#[must_use]
#[derive(Clone, Debug, Default)]
pub struct Http3OptionsBuilder {
opts: Http3Options,
}
#[non_exhaustive]
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct Http3Options {
pub max_concurrent_requests: usize,
pub max_field_section_size: u64,
pub max_qpack_decode_buffer_size: usize,
pub qpack_encoder_table_capacity: usize,
pub qpack_max_table_capacity: Option<u64>,
pub qpack_blocked_streams: Option<u64>,
pub send_grease: bool,
pub enable_extended_connect: bool,
pub settings_order: Option<Vec<SettingId>>,
}
impl Default for Http3Options {
#[inline]
fn default() -> Self {
Self {
max_concurrent_requests: 128,
max_field_section_size: 64 * 1024,
max_qpack_decode_buffer_size: 256 * 1024,
qpack_encoder_table_capacity: 0,
qpack_max_table_capacity: None,
qpack_blocked_streams: None,
send_grease: true,
enable_extended_connect: false,
settings_order: None,
}
}
}
impl Http3Options {
#[inline]
pub fn builder() -> Http3OptionsBuilder {
Http3OptionsBuilder {
opts: Self::default(),
}
}
}
impl Http3OptionsBuilder {
#[inline]
pub fn max_concurrent_requests(mut self, value: usize) -> Self {
self.opts.max_concurrent_requests = value;
self
}
#[inline]
pub fn max_field_section_size(mut self, value: u64) -> Self {
self.opts.max_field_section_size = value;
self
}
#[inline]
pub fn max_qpack_decode_buffer_size(mut self, value: usize) -> Self {
self.opts.max_qpack_decode_buffer_size = value;
self
}
#[inline]
pub fn qpack_encoder_table_capacity(mut self, value: usize) -> Self {
self.opts.qpack_encoder_table_capacity = value;
self
}
#[inline]
pub fn qpack_max_table_capacity(mut self, value: Option<u64>) -> Self {
self.opts.qpack_max_table_capacity = value;
self
}
#[inline]
pub fn qpack_blocked_streams(mut self, value: Option<u64>) -> Self {
self.opts.qpack_blocked_streams = value;
self
}
#[inline]
pub fn send_grease(mut self, value: bool) -> Self {
self.opts.send_grease = value;
self
}
#[inline]
pub fn enable_extended_connect(mut self, value: bool) -> Self {
self.opts.enable_extended_connect = value;
self
}
#[inline]
pub fn settings_order(mut self, order: Vec<SettingId>) -> Self {
self.opts.settings_order = Some(order);
self
}
#[inline]
pub fn build(self) -> Http3Options {
self.opts
}
}