[][src]Struct sixtyfps_compilerlib::CompilerConfiguration

pub struct CompilerConfiguration {
    pub embed_resources: bool,
    pub include_paths: Vec<PathBuf>,
    pub style: Option<String>,
    pub resolve_import_fallback: Option<Box<dyn Fn(String) -> Option<String>>>,
    pub open_import_fallback: Option<Box<dyn Fn(String) -> Pin<Box<dyn Future<Output = Result<String>>>>>>,
}

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")

resolve_import_fallback: Option<Box<dyn Fn(String) -> Option<String>>>

Fallback callback to resolve a relative path to an absolute path for file imports.

The callback should return the absolute path for the file specified or None if no resolution is possible.

open_import_fallback: Option<Box<dyn Fn(String) -> Pin<Box<dyn Future<Output = 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 a Ok(String) containing the text content of the file, or a Err(String) containing an error message

Implementations

impl CompilerConfiguration[src]

pub fn new(output_format: OutputFormat) -> Self[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.