Movatterモバイル変換


[0]ホーム

URL:


Docs.rs

Module module

Modulemodule 

Source
Expand description

Boa’s implementation of the ECMAScript’s module system.

This module contains theModule type, which represents anAbstract Module Record,aModuleLoader trait for custom module loader implementations, andSimpleModuleLoader,the defaultModuleLoader forContext which can be used for most simple usecases.

Every module roughly follows the same lifecycle:

TheModuleLoader trait allows customizing the “load” step on the lifecycleof a module, which allows doing things like fetching modules from urls, having multiple“modpaths” from where to import modules, or using Rust futures to avoid blocking the main threadon loads.

More information:

Modules§

embedded
Embedded module loader. Creates aModuleLoader instance that containsfiles embedded in the binary at build time.

Structs§

IdleModuleLoader
A module loader that throws when trying to load any modules.
MapModuleLoader
A module loader that uses a map of specifier -> Module to resolve.If the module was not registered, it will not be resolved.
Module
ECMAScript’sAbstract module record.
ModuleNamespace
Module namespace exotic object.
SimpleModuleLoader
A simple module loader that loads modules relative to a root path.
SyntheticModule
ECMAScript’sSynthetic Module Records.
SyntheticModuleInitializer
The initializing steps of aSyntheticModule.

Enums§

Referrer
The referrer from which a load request of a module originates.

Traits§

IntoJsModule
A trait to convert a type into a JS module.
ModuleLoader
Module loading related host hooks.

Functions§

resolve_module_specifier
Resolves paths from the referrer and the specifier, normalize the paths and ensure the pathis within a base. If the base is empty, that last verification will be skipped.

[8]ページ先頭

©2009-2025 Movatter.jp