Feat/sdk poc
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 calledROLE_DECLARATIONof typepicodata::RoleDecl - an
unsafe extern "C" fn registerwhich will be called by picodata when loading the plugin - a struct implementing the
picodata::Roletrait, which must be passed to thepicodata::RoleRegistrar::registerfunction
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