pub struct ScriptModuleLoaderAdapter { /* private fields */ }
Implementations
sourceimpl ScriptModuleLoaderAdapter
impl ScriptModuleLoaderAdapter
pub fn new(loader: Box<dyn ScriptModuleLoader<QuickJsRealmAdapter>>) -> Self
Trait Implementations
sourceimpl ModuleLoader for ScriptModuleLoaderAdapter
impl ModuleLoader for ScriptModuleLoaderAdapter
sourcefn normalize_path(
&self,
realm: &QuickJsRealmAdapter,
ref_path: &str,
path: &str
) -> Option<String>
fn normalize_path(
&self,
realm: &QuickJsRealmAdapter,
ref_path: &str,
path: &str
) -> Option<String>
the normalize methods is used to translate a possible relative path to an absolute path of a module it doubles as a method to see IF a module can actually be loaded by a module loader (return None if the module can not be found) Read more
sourcefn load_module(
&self,
realm: &QuickJsRealmAdapter,
absolute_path: &str
) -> Result<*mut JSModuleDef, JsError>
fn load_module(
&self,
realm: &QuickJsRealmAdapter,
absolute_path: &str
) -> Result<*mut JSModuleDef, JsError>
load the Module
sourcefn has_module(&self, q_ctx: &QuickJsRealmAdapter, absolute_path: &str) -> bool
fn has_module(&self, q_ctx: &QuickJsRealmAdapter, absolute_path: &str) -> bool
has module is used to check if a loader can provide a certain module, this is currently used to check which loader should init a native module
sourceunsafe fn init_module(
&self,
_q_ctx: &QuickJsRealmAdapter,
_module: *mut JSModuleDef
) -> Result<(), JsError>
unsafe fn init_module(
&self,
_q_ctx: &QuickJsRealmAdapter,
_module: *mut JSModuleDef
) -> Result<(), JsError>
init a module, currently used to init native modules Read more
Auto Trait Implementations
impl !RefUnwindSafe for ScriptModuleLoaderAdapter
impl !Send for ScriptModuleLoaderAdapter
impl !Sync for ScriptModuleLoaderAdapter
impl Unpin for ScriptModuleLoaderAdapter
impl !UnwindSafe for ScriptModuleLoaderAdapter
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more