Struct i_slint_compiler::typeloader::TypeLoader
source · [−]pub struct TypeLoader<'a> {
pub global_type_registry: Rc<RefCell<TypeRegister>>,
pub compiler_config: &'a CompilerConfiguration,
/* private fields */
}
Fields
global_type_registry: Rc<RefCell<TypeRegister>>
compiler_config: &'a CompilerConfiguration
Implementations
sourceimpl<'a> TypeLoader<'a>
impl<'a> TypeLoader<'a>
pub fn new(
global_type_registry: Rc<RefCell<TypeRegister>>,
compiler_config: &'a CompilerConfiguration,
diag: &mut BuildDiagnostics
) -> Self
sourcepub async fn load_dependencies_recursively(
&mut self,
doc: &Document,
diagnostics: &mut BuildDiagnostics,
registry_to_populate: &Rc<RefCell<TypeRegister>>
) -> Vec<ImportedTypes>
pub async fn load_dependencies_recursively(
&mut self,
doc: &Document,
diagnostics: &mut BuildDiagnostics,
registry_to_populate: &Rc<RefCell<TypeRegister>>
) -> Vec<ImportedTypes>
Imports of files that don’t have the .slint extension are returned.
pub async fn import_type(
&mut self,
file_to_import: &str,
type_name: &str,
diagnostics: &mut BuildDiagnostics
) -> Option<Type>
sourcepub fn resolve_import_path(
&self,
import_token: Option<&NodeOrToken>,
maybe_relative_path_or_url: &str
) -> (PathBuf, Option<&'static [u8]>)
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.
sourcepub async fn load_file(
&mut self,
path: &Path,
source_path: &Path,
source_code: String,
is_builtin: bool,
diagnostics: &mut BuildDiagnostics
)
pub async fn load_file(
&mut self,
path: &Path,
source_path: &Path,
source_code: String,
is_builtin: bool,
diagnostics: &mut BuildDiagnostics
)
Load a file, and its dependency not run the passes.
the path must be the canonical path
sourcepub fn find_file_in_include_path(
&self,
referencing_file: Option<&Path>,
file_to_import: &str
) -> Option<(PathBuf, Option<&'static [u8]>)>
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
sourcepub fn get_document<'b>(&'b self, path: &Path) -> Option<&'b Document>
pub fn get_document<'b>(&'b self, path: &Path) -> Option<&'b Document>
Return a document if it was already loaded
sourcepub fn all_files<'b>(&'b self) -> impl Iterator<Item = &PathBuf> + 'b
pub fn all_files<'b>(&'b self) -> impl Iterator<Item = &PathBuf> + 'b
Return an iterator over all the loaded file path
sourcepub fn all_documents(&self) -> impl Iterator<Item = &Document> + '_
pub fn all_documents(&self) -> impl Iterator<Item = &Document> + '_
Returns an iterator over all the loaded documents
Auto Trait Implementations
impl<'a> !RefUnwindSafe for TypeLoader<'a>
impl<'a> !Send for TypeLoader<'a>
impl<'a> !Sync for TypeLoader<'a>
impl<'a> Unpin for TypeLoader<'a>
impl<'a> !UnwindSafe for TypeLoader<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more