Cargo Features
[dependencies]
zng = { version = "0.12.9", default-features = false, features = ["view", "view_prebuilt", "http", "debug_default", "svg", "dyn_node", "inspector", "hot_reload", "dyn_app_extension", "dyn_closure", "test_util", "multi_app", "single_instance", "crash_handler", "trace_widget", "trace_wgt_item", "deadlock_detection", "hyphenation_embed_all", "material_icons", "material_icons_outlined", "material_icons_filled", "material_icons_rounded", "material_icons_sharp", "toml", "ron", "yaml", "view_software", "view_bundle_licenses", "ipc", "built_res", "android_game_activity", "android_native_activity"] }
- default = crash_handler, debug_default, ipc, view_software
-
These default features are set whenever
zng
is added without
somewhere in the dependency tree.default-features = false - view
-
Include the default view-process implementation.
Only enables in
not(target_arch = "wasm32")
builds.Enables zng-view
- view_prebuilt = ipc
-
Include the default view-process implementation as an embedded precompiled binary.
Only enables in
not(any(target_arch = "wasm32", target_os = "android", target_os = "ios"))
builds.Enables zng-view-prebuilt
- http
-
Enables HTTP tasks and web features of widgets and services.
Enables http of zng-ext-image, zng-ext-window, zng-task, and zng-wgt
zng-wgt:
widgets
- debug_default default
-
Enable the
"dyn_*"
,"inspector"
features in debug builds.Enables debug_default of zng-app, zng-wgt-inspector, zng-wgt-scroll, and zng-wgt-window
zng-app:
app
- svg = zng-ext-svg
-
Enable SVG images, emoji support.
Enables svg of zng-ext-font
- dyn_node
-
Use more dynamic dispatch at the node level by enabling
UiNode::cfg_boxed
to box.This speeds-up compilation time at the cost of runtime.
- inspector
-
Instrument each property and widget instance with "Inspector" nodes and extend windows to be inspected on Ctrl+Shift+I.
Enables inspector of zng-app, live of zng-wgt-inspector
- hot_reload
-
Enable hot reload builds.
Note that you must configure the target library to hot reload, see
zng::hot_reload
for details.Only enables in
not(any(target_arch = "wasm32", target_os = "android", target_os = "ios"))
builds.Enables zng-ext-hot-reload
- dyn_app_extension
-
Use dynamic dispatch at the app-extension level.
This speeds-up compilation time at the cost of runtime.Enables dyn_app_extension of zng-app
- dyn_closure
-
Box closures at opportune places, such as
Var::map
, reducing the number of monomorphised types.This speeds-up compilation time at the cost of runtime.
Enables dyn_closure of zng-wgt, zng-wgt-scroll, and zng-wgt-window
- test_util
-
Test utilities.
Enables test_util of zng-app, zng-ext-window, and zng-task
- multi_app
-
Allows multiple app instances per-process.
This feature allows multiple apps, one app per thread at a time. The
LocalContext
tracks what app is currently running in each thread andapp_local!
statics switch to the value of each app depending on the current thread.Not enabled by default, but enabled by
feature="test_util"
. - single_instance
-
Enables single app-process instance mode.
Builds with this feature only allow one app-process, subsequent attempts to spawn the app redirect to the running app-process.
Only enables in
not(any(target_arch = "wasm32", target_os = "android", target_os = "ios"))
builds.Enables zng-ext-single-instance
- crash_handler default
-
Allow app-process crash handler.
Builds with this feature spawn a crash monitor-process for each app-process.
Only enables in
not(any(target_arch = "wasm32", target_os = "android"))
builds.Enables crash_handler of zng-app and zng-wgt-inspector
- trace_widget
-
Instrument every widget outer-most node to trace UI methods.
Enables trace_widget of zng-app and zng-wgt-style
- trace_wgt_item
-
Instrument every property and intrinsic node to trace UI methods.
Note that this can cause very large trace files and bad performance.Enables trace_wgt_item of zng-app
- deadlock_detection
-
Spawns a thread on app creation that checks and prints
parking_lot
deadlocks.Enables deadlock_detection of zng-app
- hyphenation_embed_all
-
Embed hyphenation dictionaries for all supported languages.
If enabled some 2.8MB of data is embedded, you can provide an alternative dictionary source using the
HYPHENATION::init_data_source
method.Enables hyphenation_embed_all of zng-ext-font
- material_icons = material_icons_filled, material_icons_outlined, material_icons_rounded, material_icons_sharp
-
Include all Material Icons icon sets in the default app.
- material_icons_outlined material_icons?
-
Material Icons Outlined icon set.
If enabled some icons of this set are used for some of the commands.Enables embedded and outlined of zng-wgt-material-icons
- material_icons_filled material_icons?
-
Material Icons Filled icon set.
Enables embedded and filled of zng-wgt-material-icons
- material_icons_rounded material_icons?
-
Material Icons Rounded icon set.
Enables embedded and rounded of zng-wgt-material-icons
- material_icons_sharp material_icons?
-
Material Icons Sharp icon set.
Enables embedded and sharp of zng-wgt-material-icons
- toml
-
Enable TOML configs.
Enables toml of zng-ext-config
- ron
-
Enable RON configs.
Enables ron of zng-ext-config
- yaml
-
Enable YAML configs.
Enables yaml of zng-ext-config
- view_software default
-
Enables software renderer fallback in the default view-process.
If enabled and a native OpenGL 3.2 driver is not available the
swgl
software renderer is used. - view_bundle_licenses
-
Collects and bundles third-party licenses used by the
zng-view
crate.Needs
cargo-about
and Internet connection during build.Not enabled by default. Note that
"view_prebuilt"
always bundles licenses.Enables bundle_licenses of optional zng-view
- ipc default view_prebuilt?
-
Enables IPC tasks, pre-build views and connecting to views running in another process.
Only enables in
not(any(target_os = "android", target_arch = "wasm32", target_os = "ios"))
builds.Enables ipc of zng-app, zng-task, optional zng-view, and zng-view-api
zng-view-api:
view
- built_res
-
Check if
zng::env::res
path is available ininit_built_res
first.Enabled by default in debug builds, ignored in Android and Wasm.
- android_game_activity
-
Standard Android backend that requires a build system that can compile Java or Kotlin and fetch Android dependencies.
See
https://docs.rs/winit/latest/winit/platform/android/
for more details.Enables android_game_activity of optional zng-view
- android_native_activity
-
Basic Android backend that does not require Java.
See
https://docs.rs/winit/latest/winit/platform/android/
for more details.Enables android_native_activity of optional zng-view
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.