Cargo Features
[dependencies]
serenity = { version = "0.12.4", default-features = false, features = ["default_native_tls", "default_no_backend", "builder", "cache", "collector", "client", "framework", "gateway", "http", "model", "voice_model", "standard_framework", "unstable_discord_api", "utils", "voice", "tokio_task_builder", "interactions_endpoint", "chrono", "full", "simd_json", "temp_cache", "absolute_ratelimits", "rustls_backend", "native_tls_backend", "typesize"] }
- default full? = default_no_backend, rustls_backend
-
Defaults with different backends
- default_native_tls = default_no_backend, native_tls_backend
- default_no_backend default default_native_tls? = builder, cache, chrono, client, framework, gateway, http, model, standard_framework, utils
-
Serenity requires a backend, this picks all default features without a backend.
- builder default_no_backend model?
-
Enables builder structs to configure Discord HTTP requests. Without this feature, you have to construct JSON manually at some places.
Affects
serenity::builder
… - cache default_no_backend temp_cache? = dashmap, fxhash, parking_lot
-
Enables the cache, which stores the data received from Discord gateway to provide access to complete guild data, channels, users and more without needing HTTP requests.
Affects
context::Context.cache
,client::Client.cache
,help_commands::has_all_requirements
,help_commands::searched_lowercase
,help_commands::create_customised_help_data
,shard_manager::ShardManagerOptions.cache
,shard_queuer::ShardQueuer.cache
,shard_runner::ShardRunner.cache
,shard_runner::ShardRunnerOptions.cache
,http::CacheHttp.cache
,serenity::cache
,help_commands::with_embeds
,help_commands::plain
… - collector full? = gateway, model
-
Enables collectors, a utility feature that lets you await interaction events in code with zero setup, without needing to setup an InteractionCreate event listener.
Affects
serenity::collector
,quick_modal::QuickModalResponse
,quick_modal::CreateQuickModal
… - client default_no_backend framework? voice? = http, typemap_rev
-
Wraps the gateway and http functionality into a single interface TODO: should this require "gateway"?
Affects
serenity::client
… - framework default_no_backend standard_framework? = client, model, utils
-
Enables the Framework trait which is an abstraction for old-style text commands.
Affects
shard_manager::ShardManagerOptions.framework
,shard_queuer::ShardQueuer.framework
,shard_runner::ShardRunnerOptions.framework
,serenity::framework
… - gateway collector? default_no_backend = flate2
-
Enables gateway support, which allows bots to listen for Discord events.
Affects
client::ClientBuilder
,client::Client
,serenity::gateway
… - http client? default_no_backend model? = mime_guess, percent-encoding
-
Enables HTTP, which enables bots to execute actions on Discord.
Affects
builder::Builder
,tokio::spawn_named
,serenity::http
,help_commands::with_embeds
,help_commands::plain
… - model collector? default_no_backend framework? voice? = builder, http, utils
-
Enables wrapper methods around HTTP requests on model types.
Requires "builder" to configure the requests and "http" to execute them.
Note: the model type definitions themselves are always active, regardless of this feature.
TODO: remove dependeny on utils featureAffects
channel_id::MessagesIter
,channel::AttachmentType
,guild_id::MembersIter
,mention::MentionParseError
,misc::EmojiIdentifierParseError
… - voice_model full? = serenity-voice-model
- standard_framework default_no_backend = command_attr, framework, levenshtein, parking_lot, static_assertions, uwl
-
Affects
framework::standard
… - unstable_discord_api full?
-
Enables support for Discord API functionality that's not stable yet, as well as serenity APIs that are allowed to change even in semver non-breaking updates.
Affects
gateway::Activity.sync_id
,gateway::Activity.session_id
… - utils default_no_backend framework? model?
-
Enables some utility functions that can be useful for bot creators.
Affects
serenity::utils
,mention::MentionParseError
,misc::EmojiIdentifierParseError
… - voice full? = client, model
-
Affects
client::Client.voice_manager
,shard_manager::ShardManagerOptions.voice_manager
,shard_queuer::ShardQueuer.voice_manager
,shard_runner::ShardRunnerOptions.voice_manager
… - tokio_task_builder
-
Enables unstable tokio features to give explicit names to internally spawned tokio tasks
- interactions_endpoint full? = ed25519-dalek
-
Affects
serenity::interactions_endpoint
… - chrono default_no_backend
-
Uses chrono for Timestamp, instead of time
- full = collector, default, interactions_endpoint, unstable_discord_api, voice, voice_model
-
This enables all parts of the serenity codebase
(Note: all feature-gated APIs to be documented should have their features listed here!) - simd_json = simd-json
-
Enables simd accelerated parsing.
- temp_cache = cache, mini-moka
-
Enables temporary caching in functions that retrieve data via the HTTP API.
- absolute_ratelimits
-
Removed feature (https://github.com/serenity-rs/serenity/pull/2246)
- rustls_backend default = bytes
-
Backends to pick from:
- Rustls BackendsEnables rustls-tls of reqwest ^0.11.22, rustls-tls-webpki-roots of tokio-tungstenite ^0.21.0
- native_tls_backend default_native_tls? = bytes
-
- Native TLS Backends
Enables native-tls of reqwest ^0.11.22 and tokio-tungstenite ^0.21.0
Features from optional dependencies
In crates that don't use the dep:
syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.
- fxhash cache?
-
Enables fxhash
Optional dependencies
- simd-json simd_json?
-
Enables simd-json ^0.13.4
- uwl standard_framework?
- levenshtein standard_framework?
- flate2 gateway?
- reqwest native_tls_backend? rustls_backend
-
Enables reqwest ^0.11.22
- static_assertions standard_framework?
- tokio-tungstenite native_tls_backend? rustls_backend
-
Enables tokio-tungstenite ^0.21.0
- typemap_rev client?
- bytes native_tls_backend? rustls_backend
- percent-encoding http?
- mini-moka temp_cache?
- mime_guess http?
- dashmap cache?
-
Enables dashmap ^5.5.3
- parking_lot cache? standard_framework?
- ed25519-dalek interactions_endpoint?
- typesize implicit feature
-
Enables typesize
typesize:
A library to fetch an accurate estimate of the total memory usage of a value
- command_attr standard_framework?
-
Enables command_attr
serde feature only allows for serialisation,
Serenity workspace crates - serenity-voice-model voice_model?