Skip to main content

Module loader

Module loader 

Source
Expand description

Dynamic plugin loader using libloading.

Scans ~/.room/plugins/ for shared libraries (.so on Linux, .dylib on macOS) and loads them via the C ABI entry points defined in room_protocol::plugin::abi.

Each loaded plugin goes through three stages:

  1. Load the shared library
  2. Read the ROOM_PLUGIN_DECLARATION static to verify API/protocol compat
  3. Call room_plugin_create to obtain a Box<dyn Plugin>

On drop, the loader calls room_plugin_destroy before unloading the library.

Structs§

LoadedPlugin
A dynamically loaded plugin and its backing library handle.

Enums§

LoadError
Errors that can occur when loading a plugin.

Functions§

load_plugin
Load a plugin from a shared library at the given path.
scan_plugin_dir
Scan a directory for plugin shared libraries and load each one.