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_DECLARATION
of typepicodata::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 thepicodata::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