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
§Example
In your Cargo.toml:
[package]
...
build = "build.rs"
[dependencies]
slint = "1.9.0"
...
[build-dependencies]
slint-build = "1.9.0"
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
.slint
markup files to Rust.
Enums§
- Compile
Error - Error returned by the
compile
function - Embed
Resources Kind - How should the slint compiler embed images and fonts
Functions§
- compile
- Compile the
.slint
file 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