21 releases (2 stable)

new 1.0.1 Oct 31, 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

#1969 in Network programming

Download history 3813/week @ 2024-07-11 4058/week @ 2024-07-18 4736/week @ 2024-07-25 4535/week @ 2024-08-01 4371/week @ 2024-08-08 4491/week @ 2024-08-15 5414/week @ 2024-08-22 4967/week @ 2024-08-29 4213/week @ 2024-09-05 4754/week @ 2024-09-12 5494/week @ 2024-09-19 5424/week @ 2024-09-26 5020/week @ 2024-10-03 6668/week @ 2024-10-10 6917/week @ 2024-10-17 5900/week @ 2024-10-24

25,623 downloads per month
Used in 41 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 functiuons are defined automatically by declare_plugin macro.

Dependencies

~14–25MB
~357K SLoC