Crate twilight_http[−][src]
Expand description
twilight-http
HTTP support for the twilight ecosystem.
Features
Deserialization
twilight-http supports serde_json and simd-json for deserializing
responses.
simd-json
The simd-json feature enables simd-json support to use simd features
of modern cpus to deserialize responses faster. It is not enabled by
default.
To use this feature you need to also add these lines to
<project root>/.cargo/config:
[build] rustflags = ["-C", "target-cpu=native"]
You can also set the environment variable
RUSTFLAGS="-C target-cpu=native". If you enable both serde_json and
simd-json at the same time, then simd-json will be used.
To enable simd-json, do something like this in your Cargo.toml:
[dependencies]
twilight-http = { default-features = false, features = ["rustls", "simd-json"], version = "0.2" }TLS
twilight-http has features to enable hyper’s TLS features. These
features are mutually exclusive. rustls is enabled by default.
native
The native feature enables hyper’s default-tls
feature, which is mostly equivalent to using native-tls.
To enable native, do something like this in your Cargo.toml:
[dependencies]
twilight-http = { default-features = false, features = ["native"], version = "0.2" }rustls
The rustls feature enables hyper’s rustls feature, which uses
rustls as the TLS backend.
This is enabled by default.
Tracing
The tracing feature enables logging via the tracing crate.
This is enabled by default.
Re-exports
Modules
Constants
Discord API version used by this crate.