Type Definition v8::ResolveModuleCallback
source · [−]pub type ResolveModuleCallback<'a> = extern "C" fn(_: Local<'a, Context>, _: Local<'a, String>, _: Local<'a, FixedArray>, _: Local<'a, Module>) -> *const Module;
Expand description
Called during Module::instantiate_module. Provided with arguments: (context, specifier, import_assertions, referrer). Return None on error.
Note: this callback has an unusual signature due to ABI incompatibilities between Rust and C++. However end users can implement the callback as follows; it’ll be automatically converted.
ⓘ
fn my_resolve_callback<'a>(
context: v8::Local<'a, v8::Context>,
specifier: v8::Local<'a, v8::String>,
import_assertions: v8::Local<'a, v8::FixedArray>,
referrer: v8::Local<'a, v8::Module>,
) -> Option<v8::Local<'a, v8::Module>> {
// ...
Some(resolved_module)
}