pub struct CompilerConfiguration {
pub embed_resources: bool,
pub include_paths: Vec<PathBuf>,
pub style: Option<String>,
pub open_import_fallback: Option<Rc<dyn Fn(String) -> Pin<Box<dyn Future<Output = Option<Result<String>>>>>>>,
pub inline_all_elements: bool,
}
Expand description
CompilationConfiguration allows configuring different aspects of the compiler.
Fields§
§embed_resources: bool
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.
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.
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.
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
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Mutably borrows from an owned value. Read more
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>
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 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>
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