docs.rs failed to build twilight-gateway-0.15.0-rc.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
twilight-gateway-0.16.0-rc.1
twilight-gateway
twilight-gateway
is an implementation of Discord's sharding gateway sessions.
This is responsible for receiving stateful events in real-time from Discord
and sending some stateful information.
The primary type is the Shard
, a stateful interface to maintain a Websocket
connection to Discord's gateway. Much of its functionality can be configured, and
it's used to receive deserialized gateway event payloads or raw Websocket
messages, useful for load balancing and microservices.
Using the stream
module, shards can be easily managed in groups.
Features
simd-json
: usesimd-json
instead ofserde_json
for deserializing events- TLS (mutually exclusive)
native
: platform's native TLS implementation vianative-tls
equivalentsrustls-native-roots
(default):rustls
using native root certificatesrustls-webpki-roots
:rustls
usingwebpki-roots
for root certificates, useful forscratch
containers
twilight-http
(default): enable thestream::create_recommended
function- Zlib (mutually exclusive)
zlib-stock
(default): [flate2
]'s stock zlib implementationzlib-ng
: usezlib-ng
for zlib, may have better performance
Examples
Start a shard and loop over guild and voice state events:
use env;
use ;
async
Create the recommended number of shards and stream over their events:
use StreamExt;
use ;
use ;
use Client;
async
There are a few additional examples located in the repository.