pub struct TypeLoader {
    pub global_type_registry: Rc<RefCell<TypeRegister>>,
    pub compiler_config: CompilerConfiguration,
    /* private fields */
}

Fields§

§global_type_registry: Rc<RefCell<TypeRegister>>§compiler_config: CompilerConfiguration

Implementations§

source§

impl TypeLoader

source

pub fn new( global_type_registry: Rc<RefCell<TypeRegister>>, compiler_config: CompilerConfiguration, diag: &mut BuildDiagnostics ) -> Self

source

pub async fn load_dependencies_recursively<'a>( &'a mut self, doc: &'a Document, diag: &'a mut BuildDiagnostics, registry_to_populate: &'a Rc<RefCell<TypeRegister>> ) -> (Vec<ImportedTypes>, Exports)

Imports of files that don’t have the .slint extension are returned.

source

pub async fn import_component( &mut self, file_to_import: &str, type_name: &str, diag: &mut BuildDiagnostics ) -> Option<Rc<Component>>

source

pub fn resolve_import_path( &self, import_token: Option<&NodeOrToken>, maybe_relative_path_or_url: &str ) -> (PathBuf, Option<&'static [u8]>)

Append a possibly relative path to a base path. Returns the data if it resolves to a built-in (compiled-in) file.

source

pub async fn load_file( &mut self, path: &Path, source_path: &Path, source_code: String, is_builtin: bool, diag: &mut BuildDiagnostics )

Load a file, and its dependency not run the passes.

the path must be the canonical path

source

pub fn find_file_in_include_path( &self, referencing_file: Option<&Path>, file_to_import: &str ) -> Option<(PathBuf, Option<&'static [u8]>)>

Lookup a filename and try to find the absolute filename based on the include path or the current file directory

source

pub fn get_document<'b>(&'b self, path: &Path) -> Option<&'b Document>

Return a document if it was already loaded

source

pub fn all_files<'b>(&'b self) -> impl Iterator<Item = &PathBuf> + 'b

Return an iterator over all the loaded file path

source

pub fn all_documents(&self) -> impl Iterator<Item = &Document> + '_

Returns an iterator over all the loaded documents

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.