Skip to content

[Question] What is the sequence diagram using the readme interface example ? #112

@bioinfornatics

Description

@bioinfornatics

Dear,

Thanks for your works,
I am trying to understand how this crate works, thus I have some questions:

  1. At which time the plugin .so file is loaded ?
  2. about of load_from_directory function used into the example interface line 54 , what do this function. Does it try to load any .so file from given directory ?

Below my actual and fuzzy understanding

sequenceDiagram
participant App
participant MyPluginInterface
participant MyPlugin
participant RootModule as  abi_stable::library::RootModule
App ->> MyPluginInterface : use specialized defined API
MyPluginInterface ->> MyPlugin : call load_from_directory
MyPlugin ->> RootModule : call load_from_directory
RootModule  -> MysharedLib : load .so file
Loading

I would like to achieve something like:
An App which define various interfaces to let other dev extend the app via various plugins
So, the App do not know implementations (i.e the plugins) but know that plugins are all located into my/plugin/dir
The App loop over plugin into my/plugin/dir and load them

What it is blocking while reading example ?
In readme_example The readme_user app use readme_interface which implement RootModule
To my understanding at this step the interface define the plugin name that would mean into one directory only one plugin using this interface is possible, no ?

Edit: for the last part I think I understood, I should not create 1 interface by plugin but 1 interface for all kind of plugin and use the same way describe into 1_trait_objects

Thanks for your insight

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions