Struct CompilerConfiguration

Source
pub struct CompilerConfiguration {
Show 14 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 cpp_namespace: Option<String>, pub debug_info: bool, 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

§cpp_namespace: Option<String>

C++ namespace

§debug_info: bool

Generate debug information for elements (ids, type names)

§components_to_generate: ComponentSelection

Implementations§

Source§

impl CompilerConfiguration

Source

pub fn new(output_format: OutputFormat) -> Self

Trait Implementations§

Source§

impl Clone for CompilerConfiguration

Source§

fn clone(&self) -> CompilerConfiguration

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

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

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T