Cargo Features
[dependencies]
zng-app = { version = "0.13.8", default-features = false, features = ["debug_default", "dyn_node", "inspector", "dyn_app_extension", "dyn_closure", "test_util", "multi_app", "trace_widget", "trace_wgt_item", "crash_handler", "ipc", "deadlock_detection"] }
- default = debug_default, ipc
-
These default features are set whenever
zng-app
is added without
somewhere in the dependency tree.default-features = false - debug_default default
-
Enable the
"dyn_*"
and"inspector"
features in debug builds.Enables dyn_closure of zng-app-context, debug_default of zng-var
- dyn_node
-
Use dynamic dispatch at the node level by placing each property node in a
BoxedUiNode
and enablingUiNode::cfg_boxed
.This speeds-up compilation time at the cost of runtime.
Affects
match_node::match_node
,node::UiNode.cfg_boxed
… - inspector
-
Instrument each widget instance to retain build information.
- dyn_app_extension
-
Use dynamic dispatch at the app-extension level.
This speeds-up compilation time at the cost of runtime. - 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-app-context and zng-var
Affects
handler::WidgetHandler.cfg_boxed
,handler::hn
,handler::hn_once
,handler::async_hn
,handler::async_hn_once
,handler::AppHandler.cfg_boxed
,handler::app_hn
,handler::app_hn_once
,handler::async_app_hn
,handler::async_app_hn_once
… - test_util = deadlock_detection, multi_app
-
Like
cfg(test)
but also visible in docs and integration tests. - multi_app test_util?
-
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"
.Enables multi_app of zng-app-context
- trace_widget
-
Instrument every widget outer-most node to trace UI methods.
- 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. - crash_handler
-
Allow app-process crash handler.
Only enables in
not(any(target_arch = "wasm32", target_os = "android", target_os = "ios"))
builds.Enables crash-handler, linkme =0.3.28, minidump, minidumper, serde_json, and uuid
- ipc default
-
Enables IPC tasks and pre-build views and connecting to views running in another process.
Enables ipc of zng-task and zng-view-api
- deadlock_detection test_util?
-
Spawns a thread on app creation that checks and prints
parking_lot
deadlocks.Not enabled by default, but enabled by
feature="test_util"
.Enables deadlock_detection of zng-task