Crate zenoh_plugin_trait

Crate zenoh_plugin_trait 

Source
Expand description

§The plugin infrastructure for Zenoh.

This API has been marked as unstable: it works as advertised, but it may be changed in a future release.

To build a plugin, implement Plugin.

If building a plugin for zenohd, you should use the types exported in zenoh::plugins to fill Plugin’s associated types. To check your plugin typing for zenohd, have your plugin implement zenoh::plugins::ZenohPlugin

Plugin is a struct which implements the Plugin trait. This trait has two associated types:

  • StartArgs: the type of the arguments passed to the plugin’s start function.
  • Instance: the type of the plugin’s instance.

The actual work of the plugin is performed by the instance, which is created by the start function.

Plugins are loaded, started and stopped by PluginsManager. Stopping plugin is just dropping it’s instance.

Plugins can be static and dynamic.

Static plugin is just a type which implements Plugin trait. It can be added to PluginsManager by PluginsManager::declare_static_plugin method.

Dynamic plugin is a shared library which exports set of C-repr (unmangled) functions which allows to check plugin compatibility and create plugin instance. These functions are defined automatically by declare_plugin macro.

Macros§

declare_plugin
This macro adds non-mangled functions which provides plugin version and loads it into the host. If plugin library should work also as static, consider calling this macro under feature condition
plugin_long_version
plugin_version

Structs§

Compatibility
PluginReport
A plugin report contains a severity level and a list of messages describing the plugin’s situation (for the Declared state - dynamic library loading errors, for the Loaded state - plugin start errors, etc)
PluginStatusRec
The structure which contains all information about the plugin status in a single cloneable structure
PluginStructVersion
PluginVTable
PluginsManager
A plugins manager that handles starting and stopping plugins. Plugins can be loaded from shared libraries using Self::declare_dynamic_plugin_by_name or Self::declare_dynamic_plugin_by_paths, or added directly from the binary if available using Self::declare_static_plugin.

Enums§

PluginDiff
The diff in the configuration when plugins are updated:
PluginState
The plugin can be in one of these states:

Constants§

PLUGIN_LOADER_VERSION

Traits§

DeclaredPlugin
LoadedPlugin
Plugin
Base plugin trait. The loaded plugin
PluginConditionSetter
PluginControl
This trait allows getting information about the plugin status and the status of its subplugins, if any.
PluginInstance
PluginStartArgs
PluginStatus
Trait allowing getting all information about the plugin
StartedPlugin
StructVersion

Type Aliases§

PluginLoaderVersion