mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
udp: fix some config feature issues
This commit is contained in:
parent
d18117595e
commit
1e9376302d
2 changed files with 9 additions and 9 deletions
|
|
@ -18,9 +18,9 @@ pub struct Config {
|
|||
pub log_level: LogLevel,
|
||||
pub network: NetworkConfig,
|
||||
pub protocol: ProtocolConfig,
|
||||
#[cfg(feature = "with-mio")]
|
||||
#[cfg(any(feature = "with-mio", feature = "with-io-uring"))]
|
||||
pub handlers: HandlerConfig,
|
||||
#[cfg(feature = "with-mio")]
|
||||
#[cfg(any(feature = "with-mio", feature = "with-io-uring"))]
|
||||
pub statistics: StatisticsConfig,
|
||||
pub cleaning: CleaningConfig,
|
||||
pub privileges: PrivilegeConfig,
|
||||
|
|
@ -70,7 +70,7 @@ pub struct ProtocolConfig {
|
|||
pub peer_announce_interval: i32,
|
||||
}
|
||||
|
||||
#[cfg(feature = "with-mio")]
|
||||
#[cfg(any(feature = "with-mio", feature = "with-io-uring"))]
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[serde(default)]
|
||||
pub struct HandlerConfig {
|
||||
|
|
@ -80,7 +80,7 @@ pub struct HandlerConfig {
|
|||
pub channel_recv_timeout_microseconds: u64,
|
||||
}
|
||||
|
||||
#[cfg(feature = "with-mio")]
|
||||
#[cfg(any(feature = "with-mio", feature = "with-io-uring"))]
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[serde(default)]
|
||||
pub struct StatisticsConfig {
|
||||
|
|
@ -109,9 +109,9 @@ impl Default for Config {
|
|||
log_level: LogLevel::Error,
|
||||
network: NetworkConfig::default(),
|
||||
protocol: ProtocolConfig::default(),
|
||||
#[cfg(feature = "with-mio")]
|
||||
#[cfg(any(feature = "with-mio", feature = "with-io-uring"))]
|
||||
handlers: HandlerConfig::default(),
|
||||
#[cfg(feature = "with-mio")]
|
||||
#[cfg(any(feature = "with-mio", feature = "with-io-uring"))]
|
||||
statistics: StatisticsConfig::default(),
|
||||
cleaning: CleaningConfig::default(),
|
||||
privileges: PrivilegeConfig::default(),
|
||||
|
|
@ -143,7 +143,7 @@ impl Default for ProtocolConfig {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "with-mio")]
|
||||
#[cfg(any(feature = "with-mio", feature = "with-io-uring"))]
|
||||
impl Default for HandlerConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
|
|
@ -153,7 +153,7 @@ impl Default for HandlerConfig {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "with-mio")]
|
||||
#[cfg(any(feature = "with-mio", feature = "with-io-uring"))]
|
||||
impl Default for StatisticsConfig {
|
||||
fn default() -> Self {
|
||||
Self { interval: 0 }
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ pub mod common;
|
|||
pub mod config;
|
||||
#[cfg(all(feature = "with-glommio", target_os = "linux"))]
|
||||
pub mod glommio;
|
||||
#[cfg(feature = "with-mio")]
|
||||
#[cfg(any(feature = "with-mio", feature = "with-io-uring"))]
|
||||
pub mod other;
|
||||
|
||||
use config::Config;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue