pub struct CompilerConfiguration {Show 17 fields
pub embed_resources: EmbedResourcesKind,
pub include_paths: Vec<PathBuf>,
pub library_paths: HashMap<String, PathBuf>,
pub style: Option<String>,
pub open_import_fallback: Option<Rc<dyn Fn(String) -> Pin<Box<dyn Future<Output = Option<Result<String>>>>>>>,
pub resource_url_mapper: Option<Rc<dyn Fn(&str) -> Pin<Box<dyn Future<Output = Option<String>>>>>>,
pub inline_all_elements: bool,
pub const_scale_factor: f64,
pub accessibility: bool,
pub enable_experimental: bool,
pub translation_domain: Option<String>,
pub no_native_menu: bool,
pub cpp_namespace: Option<String>,
pub error_on_binding_loop_with_window_layout: bool,
pub debug_info: bool,
pub debug_hooks: Option<RandomState>,
pub components_to_generate: ComponentSelection,
}
Expand description
CompilationConfiguration allows configuring different aspects of the compiler.
Fields§
§embed_resources: EmbedResourcesKind
Indicate whether to embed resources such as images in the generated output or whether to retain references to the resources on the file system.
include_paths: Vec<PathBuf>
The compiler will look in these paths for components used in the file to compile.
library_paths: HashMap<String, PathBuf>
The compiler will look in these paths for library imports.
style: Option<String>
the name of the style. (eg: “native”)
open_import_fallback: Option<Rc<dyn Fn(String) -> Pin<Box<dyn Future<Output = Option<Result<String>>>>>>>
Callback to load import files which is called if the file could not be found
The callback should open the file specified by the given file name and return an future that provides the text content of the file as output.
resource_url_mapper: Option<Rc<dyn Fn(&str) -> Pin<Box<dyn Future<Output = Option<String>>>>>>
Callback to map URLs for resources
The function takes the url and returns the mapped URL (or None if not mapped)
inline_all_elements: bool
Run the pass that inlines all the elements.
This may help optimization to optimize the runtime resources usages, but at the cost of much more generated code and binary size.
const_scale_factor: f64
Compile time scale factor to apply to embedded resources such as images and glyphs.
If != 1.0 then the scale factor will be set on the slint::Window
.
accessibility: bool
expose the accessible role and properties
enable_experimental: bool
Add support for experimental features
translation_domain: Option<String>
The domain used as one of the parameter to the translate function
Do not generate the hook to create native menus
cpp_namespace: Option<String>
C++ namespace
error_on_binding_loop_with_window_layout: bool
When true, fail the build when a binding loop is detected with a window layout property (otherwise this is a compatibility warning)
debug_info: bool
Generate debug information for elements (ids, type names)
debug_hooks: Option<RandomState>
Generate debug hooks to inspect/override properties.
components_to_generate: ComponentSelection
Implementations§
Source§impl CompilerConfiguration
impl CompilerConfiguration
pub fn new(output_format: OutputFormat) -> Self
Trait Implementations§
Source§impl Clone for CompilerConfiguration
impl Clone for CompilerConfiguration
Source§fn clone(&self) -> CompilerConfiguration
fn clone(&self) -> CompilerConfiguration
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for CompilerConfiguration
impl !RefUnwindSafe for CompilerConfiguration
impl !Send for CompilerConfiguration
impl !Sync for CompilerConfiguration
impl Unpin for CompilerConfiguration
impl !UnwindSafe for CompilerConfiguration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more