pub struct Loader<S, P, R> { /* private fields */ }Expand description
Combined file loader, lexer, and parser for multiple modules.
Implementations§
Source§impl<'s, P: Default> Loader<&'s str, P, fn(Import<'_, &str, P>) -> Result<File<String, P>, String>>
impl<'s, P: Default> Loader<&'s str, P, fn(Import<'_, &str, P>) -> Result<File<String, P>, String>>
Sourcepub fn new(prelude: impl IntoIterator<Item = Def<&'s str>>) -> Self
pub fn new(prelude: impl IntoIterator<Item = Def<&'s str>>) -> Self
Initialise the loader with prelude definitions.
The prelude is a special module that is implicitly included by all other modules (including the main module). That means that all filters defined in the prelude can be called from any module.
The prelude is normally initialised with filters like map or true.
Source§impl<S, P, R> Loader<S, P, R>
impl<S, P, R> Loader<S, P, R>
Sourcepub fn with_read<R2>(self, read: R2) -> Loader<S, P, R2>
pub fn with_read<R2>(self, read: R2) -> Loader<S, P, R2>
Provide a function to return the contents of included/imported module files.
For every included/imported module, the loader will call this function to
obtain the contents of the module.
For example, if we have include "foo", the loader calls read("foo").
Auto Trait Implementations§
impl<S, P, R> Freeze for Loader<S, P, R>where
R: Freeze,
impl<S, P, R> RefUnwindSafe for Loader<S, P, R>
impl<S, P, R> Send for Loader<S, P, R>
impl<S, P, R> Sync for Loader<S, P, R>
impl<S, P, R> Unpin for Loader<S, P, R>
impl<S, P, R> UnwindSafe for Loader<S, P, R>
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