#[macro_use]
extern crate serde;
macro_rules! for_each_h2_knob_floor {
($callback:ident, $config:ident) => {
$callback!($config, h2_max_rst_stream_per_window, 1);
$callback!($config, h2_max_ping_per_window, 1);
$callback!($config, h2_max_settings_per_window, 1);
$callback!($config, h2_max_empty_data_per_window, 1);
$callback!($config, h2_max_window_update_stream0_per_window, 1);
$callback!($config, h2_max_continuation_frames, 1);
$callback!($config, h2_max_glitch_count, 1);
$callback!($config, h2_max_rst_stream_lifetime, 1);
$callback!($config, h2_max_rst_stream_abusive_lifetime, 1);
$callback!($config, h2_max_rst_stream_emitted_lifetime, 1);
$callback!($config, h2_max_header_list_size, 1);
$callback!($config, h2_max_header_table_size, 1);
$callback!($config, h2_max_header_fields, 1);
$callback!($config, h2_max_concurrent_streams, 1);
$callback!($config, h2_stream_shrink_ratio, 2);
};
}
pub(crate) use for_each_h2_knob_floor;
#[macro_use]
pub mod logging;
pub mod buffer;
pub mod certificate;
pub mod channel;
pub mod config;
pub mod listener_key;
pub mod parser;
pub mod proto;
pub mod ready;
pub mod request;
pub mod response;
pub mod scm_socket;
pub mod sd_notify;
pub mod state;
pub mod writer;
#[derive(Debug)]
pub enum ObjectKind {
Backend,
Certificate,
Cluster,
HttpFrontend,
HttpsFrontend,
HttpListener,
HttpsListener,
Listener,
TcpCluster,
TcpListener,
TcpFrontend,
UdpListener,
UdpFrontend,
}
pub trait AsString {
fn as_string_or(&self, default: &'static str) -> String;
}
impl<T: ToString> AsString for Option<T> {
fn as_string_or(&self, default: &'static str) -> String {
match self {
None => default.to_string(),
Some(t) => t.to_string(),
}
}
}
pub trait AsStr {
fn as_str_or(&self, default: &'static str) -> &str;
}
impl<T: AsRef<str>> AsStr for Option<T> {
fn as_str_or(&self, default: &'static str) -> &str {
match self {
None => default,
Some(s) => s.as_ref(),
}
}
}