1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use common::CommonConf;

#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ServerAlpn {
    // Ignore negotiated ALPN
    Ignore,
    // Return error is ALPN is not "h2"
    Require,
}

#[derive(Default, Debug, Clone)]
pub struct ServerConf {
    /// TCP_NODELAY
    pub no_delay: Option<bool>,
    pub thread_name: Option<String>,

    pub alpn: Option<ServerAlpn>,

    // Bind on both IPv4 and IPv6 addresses when addr is IPv6
    pub only_v6: Option<bool>,

    /// Ignored on Windows
    pub reuse_port: Option<bool>,
    pub backlog: Option<i32>,

    pub common: CommonConf,
}

impl ServerConf {
    pub fn new() -> ServerConf {
        Default::default()
    }
}