Crate dusk_api

Source
Expand description

Crate, that is used while building a plugin system as a common dependency by both plugin and plugin user to define the plugin behavior and safely import and use the plugin

§Plugin Side

To quickly learn how to create a plugin and export functions from it see export_freight! macro documentation

§Importer Side

To quickly learn how to import and use plugins see FreightProxy documentation

Macros§

export_freight
A macro, which must be used for exporting a struct.
export_plugin
A macro, which can be used to make exporting of a struct easier
import_plugin
A macro, that makes plugin importing a little bit easier
register_freight
A macro, which can be used to create a registry function easier

Structs§

EmptyFreight
Structure representing an empty Freight implementor, needed only for FreightProxy configuration
FreightDeclaration
A structure, exported by plugin, containing some package details and register function
FreightProxy
A structure, that contains a Freight object and is used to import and use it safely
Function
Structure representing main characteristics of a function needed for the program using a plugin, which implements it
Type
Structure representing main characteristics of an object type needed for the program, using the plugin, that either imports or defines this type in case this type is not present in the user program itself

Enums§

InterplugRequest
Enum, that represents an interplugin request and either contains a InterplugRequest::Crucial plugin request (must be provided in order for the plugin to work or an InterplugRequest::Optional plugin request which may be denied
Limitation
Enum that represents a system limitation, that a plugin either needs to know to work correctly, or should be notified of in case main program wants to limit some settings
RuntimeError
Enum, that represents a message passed to the program using the plugin when the function fails

Statics§

API_VERSION
Api version parameter, passed from the build script.
RUSTC_VERSION
Rust compiler version parameter, passed from the compiler.

Traits§

Freight
Trait, that defines the plugin behavior
FreightRegistrar
Trait to be implemented on structs, which are used to register or store the imported plugins