Skip to content

Optional Features

To control the size of the application binary package, Deft provides some features as optional features. Currently, the following optional features are supported:

FeatureEnbaled by DefaultFunctionality
glYesGPU rendering (must be enbaled for mobile devices)
httpYesHTTP network requests
websocketYesWebSocket requests
trayYesSystem status bar icon
audioNoAudio playback (not yet supported on HarmonyOS)
clipboardNoClipboard
dialogNoDialog boxes (PC-only support)
sqliteNoSQLite database read/write

Configure Optional Features

Optional features are configured in the Cargo.toml file, which is located in the project root directory.

If you want to disable the default features, you need to set default-features to false and set features to the features you want to enable.

For example, if you only want to enable the http and websocket features, you need to modify the deft dependency to the following:

[dependencies]
deft = { version = "0.7.1", default-features = false, features = ["http", "websocket"] }

For more feature usage, please refer to the rust official documentation.