Skip to content

Feat/sdk poc

Georgy Moshkin requested to merge feat/sdk-poc into master

src/lib.rs now contains the public api used by user defined plugins

an example plugin can be found in roles/toy currently the plugin must define these things:

  • a static #[no_mangle] variable called ROLE_DECLARATION of type picodata::RoleDecl
  • an unsafe extern "C" fn register which will be called by picodata when loading the plugin
  • a struct implementing the picodata::Role trait, which must be passed to the picodata::RoleRegistrar::register function

This list seems kinda bloated and redundant, maybe we should trim it down a bit?

to test run

cargo build --all # so that the libtoy.so plugin is compiled
cargo run -- run --roles toy # the libtoy.so will be looked for in the target/debug directory
Edited by Georgy Moshkin

Merge request reports