@@ -58,27 +58,17 @@ This is enabled by default.
5858The ` rustls-webpki-roots ` feature enables [ ` tokio-websockets ` ] '
5959` rustls-webpki-roots ` feature.
6060
61- ### Compression
61+ ### Transport compression
6262
6363` twilight-gateway ` supports both Zlib and Zstandard transport compression.
6464
65- #### Zlib (deprecated)
65+ #### Zlib
6666
67- Zlib allows specifying two different backends.
67+ The ` zlib ` feature implementation is ` target_arch ` dependent:
6868
69- ##### Stock
70-
71- The ` zlib-stock ` feature makes [ flate2] use of the stock Zlib which is either
72- upstream or the one included with the operating system.
73-
74- ##### SIMD
75-
76- ` zlib-simd ` enables the use of [ zlib-ng] which is a modern fork of zlib that in
77- most cases will be more effective. However, this will add an external dependency
78- on [ cmake] .
79-
80- If both are enabled or if the ` zlib ` feature of [ flate2] is enabled anywhere in
81- the dependency tree it will make use of that instead of [ zlib-ng] .
69+ | s390x | other |
70+ | --------------- | ----------- |
71+ | [ ` zlib-ng-sys ` ] | [ ` zlib-rs ` ] |
8272
8373#### Zstandard
8474
@@ -99,6 +89,9 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
9989 // Initialize the tracing subscriber.
10090 tracing_subscriber::fmt::init();
10191
92+ // Select rustls backend
93+ rustls::crypto::ring::default_provider().install_default().unwrap();
94+
10295 let token = env::var("DISCORD_TOKEN")?;
10396 let intents = Intents::GUILD_MESSAGES;
10497 let mut shard = Shard::new(ShardId::ONE, token, intents);
@@ -128,11 +121,10 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
128121
129122[ img:shard ] : ./section_3_shard.png
130123[ RusTLS ] : https://crates.io/crates/rustls
131- [ cmake ] : https://cmake.org/
132- [ flate2 ] : https://github.com/alexcrichton/flate2-rs
133- [ zlib-ng ] : https://github.com/zlib-ng/zlib-ng
134124[ `hyper-rustls` ] : https://crates.io/crates/hyper-rustls
135125[ `hyper-tls` ] : https://crates.io/crates/hyper-tls
136126[ `serde_json` ] : https://crates.io/crates/serde_json
137127[ `simd-json` ] : https://crates.io/crates/simd-json
138128[ `tokio-websockets` ] : https://crates.io/crates/tokio-websockets
129+ [ `zlib-ng-sys` ] : https://crates.io/crates/libz-ng-sys
130+ [ `zlib-rs` ] : https://crates.io/crates/zlib-rs
0 commit comments