Expand description
This crate serves as a companion crate of the slint crate.
It is meant to allow you to compile the .slint files from your build.rs script.
The main entry point of this crate is the compile() function
The generated code must be included in your crate by using the slint::include_modules!() macro.
§Example
In your Cargo.toml:
[package]
...
build = "build.rs"
[dependencies]
slint = "1.14"
...
[build-dependencies]
slint-build = "1.14"In the build.rs file:
ⓘ
fn main() {
slint_build::compile("ui/hello.slint").unwrap();
}Then in your main file
ⓘ
slint::include_modules!();
fn main() {
HelloWorld::new().run();
}Structs§
- Compiler
Configuration - The structure for configuring aspects of the compilation of
.slintmarkup files to Rust.
Enums§
- Compile
Error - Error returned by the
compilefunction - Embed
Resources Kind - How should the slint compiler embed images and fonts
Functions§
- compile
- Compile the
.slintfile and generate rust code for it. - compile_
with_ config - Same as
compile, but allow to specify a configuration. - compile_
with_ output_ path - Similar to
compile_with_config, but meant to be used independently of cargo. - print_
rustc_ flags - This function is for use the application’s build script, in order to print any device specific build flags reported by the backend