[][src]Type Definition dart_sys::Dart_LibraryTagHandler

type Dart_LibraryTagHandler = Option<unsafe extern "C" fn(tag: Dart_LibraryTag, library_or_package_map_url: Dart_Handle, url: Dart_Handle) -> Dart_Handle>;

The library tag handler is a multi-purpose callback provided by the embedder to the Dart VM. The embedder implements the tag handler to provide the ability to load Dart scripts and imports.

-- TAGS --

Dart_kCanonicalizeUrl

This tag indicates that the embedder should canonicalize 'url' with respect to 'library'. For most embedders, the Dart_DefaultCanonicalizeUrl function is a sufficient implementation of this tag. The return value should be a string holding the canonicalized url.

Dart_kImportTag

This tag is used to load a library from IsolateMirror.loadUri. The embedder should call Dart_LoadLibraryFromKernel to provide the library to the VM. The return value should be an error or library (the result from Dart_LoadLibraryFromKernel).

Dart_kKernelTag

This tag is used to load the intermediate file (kernel) generated by the Dart front end. This tag is typically used when a 'hot-reload' of an application is needed and the VM is 'use dart front end' mode. The dart front end typically compiles all the scripts, imports and part files into one intermediate file hence we don't use the source/import or script tags. The return value should be an error or a TypedData containing the kernel bytes.

Dart_kImportExtensionTag

This tag is used to load an external import (shared object file). The extension path must have the scheme 'dart-ext:'.