[−][src]Struct gluon::import::Import
Macro which rewrites occurances of import! "filename"
to a load of that file if it is not
already loaded and then a global access to the loaded module
Fields
paths: RwLock<Vec<PathBuf>>
loaders: RwLock<FnvMap<String, ExternLoader>>
importer: I
Methods
impl<I> Import<I>
[src]
pub fn new(importer: I) -> Import<I>
[src]
Creates a new import macro
pub fn add_path<P: Into<PathBuf>>(&self, path: P)
[src]
Adds a path to the list of paths which the importer uses to find files
pub fn set_paths(&self, paths: Vec<PathBuf>)
[src]
pub fn add_loader(&self, module: &str, loader: ExternLoader)
[src]
pub fn modules(&self) -> Vec<Cow<'static, str>>
[src]
pub fn load_module(
&self,
compiler: &mut Compiler,
vm: &Thread,
macros: &mut MacroExpander,
module_id: &Symbol,
span: Span<BytePos>
) -> Result<Option<impl Future<Item = (), Error = ()>>, (Option<ArcType>, MacroError)> where
I: Importer,
[src]
&self,
compiler: &mut Compiler,
vm: &Thread,
macros: &mut MacroExpander,
module_id: &Symbol,
span: Span<BytePos>
) -> Result<Option<impl Future<Item = (), Error = ()>>, (Option<ArcType>, MacroError)> where
I: Importer,
Trait Implementations
impl<I> Macro for Import<I> where
I: Importer,
[src]
I: Importer,
fn expand(
&self,
macros: &mut MacroExpander,
args: Vec<SpannedExpr<Symbol>>
) -> MacroFuture
[src]
&self,
macros: &mut MacroExpander,
args: Vec<SpannedExpr<Symbol>>
) -> MacroFuture
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: Any,
T: Any,
impl<D, T> FromPtr for T
[src]
impl<F> Macro for F where
F: Send + Sync + Clone + Any + Fn(&mut MacroExpander, Vec<Spanned<Expr<Symbol>, ByteIndex>>) -> Box<dyn Future<Item = Spanned<Expr<Symbol>, ByteIndex>, Error = Box<dyn Error + 'static + Sync + Send>> + 'static + Send>,
[src]
F: Send + Sync + Clone + Any + Fn(&mut MacroExpander, Vec<Spanned<Expr<Symbol>, ByteIndex>>) -> Box<dyn Future<Item = Spanned<Expr<Symbol>, ByteIndex>, Error = Box<dyn Error + 'static + Sync + Send>> + 'static + Send>,
fn expand(
&self,
env: &mut MacroExpander,
args: Vec<Spanned<Expr<Symbol>, ByteIndex>>
) -> Box<dyn Future<Item = Spanned<Expr<Symbol>, ByteIndex>, Error = Box<dyn Error + 'static + Sync + Send>> + 'static + Send>
[src]
&self,
env: &mut MacroExpander,
args: Vec<Spanned<Expr<Symbol>, ByteIndex>>
) -> Box<dyn Future<Item = Spanned<Expr<Symbol>, ByteIndex>, Error = Box<dyn Error + 'static + Sync + Send>> + 'static + Send>
impl<T> Any for T where
T: Any,
T: Any,
fn get_type_id(&self) -> TypeId
impl<Choices> CoproductSubsetter for Choices
type Remainder = Choices
fn subset(
self
) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>
self
) -> Result<CNil, <Choices as CoproductSubsetter<CNil, HNil>>::Remainder>
impl<Source> Sculptor for Source
impl<T, U, I> LiftInto for T where
U: LiftFrom<T, I>,
U: LiftFrom<T, I>,