Cargo Features
[dependencies]
kas = { version = "0.15.0", default-features = false, features = ["minimal", "stable", "nightly", "experimental", "dynamic", "min_spec", "spec", "view", "wgpu", "internal_doc", "clipboard", "markdown", "shaping", "serde", "yaml", "json", "ron", "toml", "image", "resvg", "tiny-skia", "dark-light", "spawn", "macros_log", "winit", "wayland", "x11", "recursive-layout-widgets", "unsafe_node"] }
To build locally:
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --features=stable,internal_doc --all --no-deps --open
- minimal default = wayland, wgpu, winit
-
meta / build features
The minimal feature set needed to build basic applications (with assumptions about target platforms).
Note: only some examples build in this configuration; others need view,
markdown, resvg. Recommended also: clipboard, yaml (or some config format). - default stable? = clipboard, image, markdown, minimal, resvg, shaping, spawn, view
-
All recommended features for optimal experience
- stable nightly? = default, json, macros_log, ron, serde, toml, x11, yaml
-
All standard test target features
- nightly = min_spec, stable
-
Enables all "recommended" features for nightly rustc
- experimental = dark-light, recursive-layout-widgets, unsafe_node
-
Additional, less recommendation-worthy features
- dynamic
-
Enable dynamic linking (faster linking via an extra run-time dependency):
Enables kas-dylib
- min_spec nightly? spec?
-
Use min_specialization (enables access key underlining for AccessLabel)
Enables min_spec of kas-widgets
- spec = min_spec
-
Use full specialization
- view default
-
optional dependencies / features
Enable view widgetsEnables kas-view
- wgpu minimal
-
Enable WGPU backend:
Enables kas-wgpu
Affects
kas::runner.Default
… - internal_doc
-
Enables documentation of APIs for graphics library and platform backends.
This API is not intended for use by end-user applications and thus is omitted from built documentation by default.
This flag does not change the API, only built documentation.Enables internal_doc of kas-core and optional kas-wgpu
- clipboard default
-
Enables clipboard read/write
- markdown default
-
Enable Markdown parsing
- shaping default
-
Enable text shaping
- serde json? ron? stable? toml? yaml?
-
Enable serde support (mainly config read/write)
- yaml stable? = serde
-
Enable support for YAML (de)serialisation
- json stable? = serde
-
Enable support for JSON (de)serialisation
- ron stable? = serde
-
Enable support for RON (de)serialisation
- toml stable? = serde
-
Enable support for TOML (de)serialisation
- image default
-
Support image loading and decoding
Enables image of kas-core and kas-widgets
- resvg default
-
Enable resvg module (Canvas + Svg widgets)
Enables svg of kas-resvg, resvg of optional kas-dylib
Affects
kas::resvg
… - tiny-skia
-
Enable resvg module (Canvas only)
Enables kas-resvg
Affects
kas::resvg
… - dark-light experimental?
-
Automatically detect usage of dark theme
Not a default dependency; see https://github.com/emilk/egui/issues/2388
Enables dark-light of kas-core
- spawn default
-
Support spawning async tasks
- macros_log stable?
-
Support SVG images
Inject logging into macro-generated code.
Requires that all crates using these macros depend on the log crate.Enables macros_log of kas-core
- winit minimal
-
kas-core:
Enable winit support
- wayland minimal
-
Support Wayland
- x11 stable?
-
Support X11
- recursive-layout-widgets experimental?
-
Optimize generated layout widgets
Recursive layout macros allow the generation of complex layout widgets; for example
row!["a", column!["b", "c"]]
yields a single layout widget (over threeStrLabel
widgets) instead of two separate layout widgets. (Note that this happens anyway in custom widget layout syntax where it is requried to support reference to widget fields.)A limited number of method calls such as
.align(AlignHints::LEFT)
and.map_any()
are supported but are not linked correctly via rust-analyzer.Often results in unused import warnings, hence you may want to use RUSTFLAGS="-A unused_imports".
Enables recursive-layout-widgets of kas-core
- unsafe_node experimental?
-
Optimize Node using unsafe code
Enables unsafe_node of kas-core