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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
use crate::solicit::frame::HttpSettings;
use std::u32;
pub(crate) mod end_stream;
pub(crate) mod error_code;
pub mod frame;
pub mod header;
pub mod session;
pub(crate) mod stream_id;
pub(crate) mod window_size;
pub const DEFAULT_SETTINGS: HttpSettings = HttpSettings {
header_table_size: 4_096,
enable_push: true,
max_concurrent_streams: u32::MAX,
initial_window_size: 65_535,
max_frame_size: 16_384,
max_header_list_size: u32::MAX,
};
pub const ALPN_PROTOCOLS: &'static [&'static [u8]] = &[b"h2", b"h2-16", b"h2-15", b"h2-14"];
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum HttpScheme {
Http,
Https,
}
impl HttpScheme {
#[inline]
pub fn as_bytes(&self) -> &'static [u8] {
match *self {
HttpScheme::Http => b"http",
HttpScheme::Https => b"https",
}
}
}
#[cfg(test)]
pub mod tests;