22 releases (3 stable)

1.0.2 Nov 8, 2024
1.0.0-beta.3 Sep 20, 2024
1.0.0-alpha.5 Jul 26, 2024
0.11.0 Jun 4, 2024
0.5.0-beta.9 Nov 24, 2021

#1930 in Network programming

Download history 4132/week @ 2024-07-27 4593/week @ 2024-08-03 4325/week @ 2024-08-10 4820/week @ 2024-08-17 5791/week @ 2024-08-24 4488/week @ 2024-08-31 4189/week @ 2024-09-07 5228/week @ 2024-09-14 5496/week @ 2024-09-21 4682/week @ 2024-09-28 6300/week @ 2024-10-05 6665/week @ 2024-10-12 6636/week @ 2024-10-19 5999/week @ 2024-10-26 4977/week @ 2024-11-02 4028/week @ 2024-11-09

22,903 downloads per month
Used in 42 crates (14 directly)

EPL-2.0 OR Apache-2.0

560KB
12K SLoC

⚠️ WARNING ⚠️

This crate is intended for Zenoh's internal use.


lib.rs:

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.

Dependencies

~14–25MB
~358K SLoC