Struct 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§

Source§

impl<'a> TypeLoader<'a>

Source

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

Source

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 .60 extension are returned.

Source

pub async fn import_type( &mut self, file_to_import: &str, type_name: &str, diagnostics: &mut BuildDiagnostics, ) -> Option<Type>

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, diagnostics: &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§

§

impl<'a> Freeze for TypeLoader<'a>

§

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§

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> 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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,