Struct sdml_parse::load::FsModuleLoader
source · pub struct FsModuleLoader { /* private fields */ }Expand description
The loader is used to manage the process of creating an in-memory model from file-system resources.
A Module Loader is therefore responsible for:
- finding the resource that contains a module definition,
- parsing the source into an in-memory representation,
- caching the loaded module, and it’s source, for future use.
Implementations§
source§impl FsModuleLoader
impl FsModuleLoader
pub fn with_resolver(self, resolver: FsModuleResolver) -> Self
sourcepub fn load_from_file(
&mut self,
file: PathBuf,
cache: &mut ModuleCache,
recursive: bool
) -> Result<Identifier, Error>
pub fn load_from_file( &mut self, file: PathBuf, cache: &mut ModuleCache, recursive: bool ) -> Result<Identifier, Error>
Load a module from the source in file.
sourcepub fn load_from_reader(
&mut self,
reader: &mut dyn Read,
cache: &mut ModuleCache,
recursive: bool
) -> Result<Identifier, Error>
pub fn load_from_reader( &mut self, reader: &mut dyn Read, cache: &mut ModuleCache, recursive: bool ) -> Result<Identifier, Error>
Load a module reading the source from reader.
Trait Implementations§
source§impl Debug for FsModuleLoader
impl Debug for FsModuleLoader
source§impl Default for FsModuleLoader
impl Default for FsModuleLoader
source§impl ModuleLoader for FsModuleLoader
impl ModuleLoader for FsModuleLoader
fn load( &mut self, name: &Identifier, from: Option<FileId>, cache: &mut ModuleCache, recursive: bool ) -> Result<Identifier, Error>
fn resolver(&self) -> &impl ModuleResolver
fn get_file_id(&self, name: &Identifier) -> Option<FileId>
fn get_source(&self, file_id: FileId) -> Option<Source>
fn report(&self, diagnostic: &Diagnostic) -> Result<(), Error>
fn reporter_done(&self, top_module_name: Option<String>) -> Result<(), Error>
fn get_source_by_name(&self, name: &Identifier) -> Option<Source>
Auto Trait Implementations§
impl !RefUnwindSafe for FsModuleLoader
impl Send for FsModuleLoader
impl !Sync for FsModuleLoader
impl Unpin for FsModuleLoader
impl UnwindSafe for FsModuleLoader
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