Skip to main content

Crate tocat_plugins

Crate tocat_plugins 

Source
Expand description

Native plugins: implementations compiled into the tocat binary, as opposed to WASM modules loaded at runtime.

Both kinds implement tocat_api::Plugin and are looked up through the same Registry, so the relay cannot tell them apart.

Every plugin is a module here, behind a cargo feature, and a feature enables both the module and whatever optional dependencies it needs: a build without compress never compiles zstd, and one without wasm never compiles wasmtime. A crate boundary would buy nothing that does not already buy.

register_native is the only thing this crate exports. No module can reach another and the binary cannot reach any of them, which is what lets a plugin change shape without anything above noticing.

Functionsยง

native_registry
A registry containing every plugin compiled into this binary.
register_native
Add the compiled-in plugins to an existing registry.