Core and the app · crate

kinogaki-plugin-host

Core

Studio's plugin loader.

Repository
Core and the app (kinogaki/studio-core)
Folder
studio/core/plugin-host
Source
8 files, 1,208 lines
Tests
0 files, 0 lines
depends onused by tests alonedependencies for tests alone are listed below, not drawn

What it is

Studio's plugin loader.

A plugin is a Rust dylib exporting its package (kinogaki_studio_api::export_package!), with a manifest beside it (Manifest: its id, kind, version and the packages it needs), in a kind folder (renders/, nodes/, formats/, kernels/) of the application's or the user's plugin folder (Folders).

Plugins::load finds them all (scan), chooses what to load before loading anything (resolve: one per id, the application's first; only those whose dependencies load too, dependencies first), then opens each library, checks it was compiled against this Studio's build of the shared libraries, calls its entry once and has the host admit the package it returns (load: Studio's registry checks it, and refuses one that clashes with what is installed). Libraries are never unloaded. What can't be loaded is Unavailable, with a line for the Console saying why.

The build. Studio and its plugins share one standard library and one build of the SDK and the other shared crates (kinogaki-shared, the kit). Nothing at link time notices a plugin compiled against another build (it loads, then misbehaves), so each plugin records the build it was compiled against (kinogaki_shared::link!) and the loader compares it with kinogaki_shared::BUILD, the build of the library Studio runs with, before it calls anything in the plugin. This crate is the only one in Studio allowed unsafe, in sys.rs alone.

Depends on

CrateRepositoryAsWhat it is
kinogaki-prismlib-prismnormalPrism documents for Kinogaki.
kinogaki-sharedCore and the appnormalThe crates Studio and its plugins share, built once as a Rust dylib.
kinogaki-studio-apiSDKnormalKinogaki Studio's headless plugin API.

Third-party

None.

Used by

CrateRepositoryAsWhat it is
kinogaki-editorCore and the appnormalKinogaki Studio's editor: the document and everything the window shows of it, as parts one frame borrows one by one.
kinogaki-studioCore and the apptestsKinogaki Studio: the editor in a window, after the plugins load.

Modules

Public types and traits

At the crate root

Structs FoldersFoundLoadedManifestManifestErrorPluginsUnavailable

Enums InstallKindWhy

By module: 9 public types and traits in 4 modules

choice CandidateOnly

load Loaded

manifest KindManifestManifestError

scan FoldersFoundInstall

Besides these, 7 public functions at module level.