Crate slint_build

Source
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§

CompilerConfiguration
The structure for configuring aspects of the compilation of .slint markup files to Rust.

Enums§

CompileError
Error returned by the compile function
EmbedResourcesKind
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