pub struct ModuleLoader<T: ModuleResolver = DefaultModuleResolver> { /* private fields */ }Implementations§
Source§impl<T: ModuleResolver> ModuleLoader<T>
impl<T: ModuleResolver> ModuleLoader<T>
pub fn new(resolver: T) -> Self
pub fn module_name(&self, module_id: ModuleId) -> Cow<'static, str>
pub fn get_module_path(&self, module_name: &str) -> Result<String, ModuleError>
pub fn search_paths(&self) -> Vec<PathBuf>
pub fn set_search_paths(&mut self, paths: Vec<PathBuf>)
pub fn load( &mut self, module_name: &str, code: &str, token_arena: Shared<SharedCell<Arena<Shared<Token>>>>, ) -> Result<Module, ModuleError>
pub fn load_from_ast( &mut self, module_name: &str, program: &mut Program, ) -> Result<Module, ModuleError>
pub fn canonical_name<'a>(&self, module_path: &'a str) -> &'a str
pub fn load_from_file( &mut self, module_path: &str, token_arena: Shared<SharedCell<Arena<Shared<Token>>>>, ) -> Result<Module, ModuleError>
pub fn resolve(&self, module_name: &str) -> Result<String, ModuleError>
pub fn load_builtin( &mut self, token_arena: Shared<SharedCell<Arena<Shared<Token>>>>, ) -> Result<Module, ModuleError>
pub fn get_source_code( &self, module_id: ModuleId, source_code: String, ) -> Result<String, ModuleError>
Sourcepub fn module_file_name(&self, module_id: ModuleId) -> String
pub fn module_file_name(&self, module_id: ModuleId) -> String
Returns the display filename for a module (e.g. "builtin.mq", "csv.mq", "" for top-level).
Trait Implementations§
Source§impl<T: Clone + ModuleResolver> Clone for ModuleLoader<T>
impl<T: Clone + ModuleResolver> Clone for ModuleLoader<T>
Source§fn clone(&self) -> ModuleLoader<T>
fn clone(&self) -> ModuleLoader<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug + ModuleResolver> Debug for ModuleLoader<T>
impl<T: Debug + ModuleResolver> Debug for ModuleLoader<T>
Source§impl<T: ModuleResolver> Default for ModuleLoader<T>
impl<T: ModuleResolver> Default for ModuleLoader<T>
Auto Trait Implementations§
impl<T> Freeze for ModuleLoader<T>where
T: Freeze,
impl<T> RefUnwindSafe for ModuleLoader<T>where
T: RefUnwindSafe,
impl<T> Send for ModuleLoader<T>where
T: Send,
impl<T> Sync for ModuleLoader<T>where
T: Sync,
impl<T> Unpin for ModuleLoader<T>where
T: Unpin,
impl<T> UnsafeUnpin for ModuleLoader<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ModuleLoader<T>where
T: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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