[][src]Struct gluon::import::Import

pub struct Import<I = DefaultImporter> {
    pub paths: RwLock<Vec<PathBuf>>,
    pub loaders: RwLock<FnvMap<String, ExternLoader>>,
    pub importer: I,
    // some fields omitted
}

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]

Trait Implementations

impl<I> Macro for Import<I> where
    I: Importer
[src]

Auto Trait Implementations

impl<I> Sync for Import<I> where
    I: Sync

impl<I> Unpin for Import<I> where
    I: Unpin

impl<I> Send for Import<I> where
    I: Send

impl<I> UnwindSafe for Import<I> where
    I: UnwindSafe

impl<I> RefUnwindSafe for Import<I> where
    I: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<D, T> FromPtr<D> 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<Error = Box<dyn Error + 'static + Send + Sync>, Item = Spanned<Expr<Symbol>, ByteIndex>> + 'static + Send>, 
[src]

impl<Choices> CoproductSubsetter<CNil, HNil> for Choices

type Remainder = Choices

impl<Source> Sculptor<HNil, HNil> for Source

type Remainder = Source

impl<T, U, I> LiftInto<U, I> for T where
    U: LiftFrom<T, I>, 

impl<T> Any for T where
    T: Any