covey-plugin
Rust bindings for a covey plugin.
See a bunch of examples in covey-plugins. Protobuf definitions are in proto/plugin.proto, if you want to make bindings for another language.
Usage
Example implementation below. For more details, see this crate's documentation.
Add covey-plugin as a dependency to Cargo.toml.
use ;
// store any configuration / cache here.
// if none are needed, a unit struct `struct Open;` will work.
// generates types from reading `../manifest.toml`.
// also defines an extension trait for methods like `.on_activate`.
include_manifest!;
Bindings for other languages
Currently, only Rust bindings exist. Bindings for other languages may be made in the future.
The program needs to run a server with RPC services that follow the protobuf definition.
- When initialising, it needs to connect to a port in loopback (
[::1]) and print the port to stdout (e.g.12345).- The covey backend will then connect to
http://[::1]:<port>.
- The covey backend will then connect to
- If an error occurs during initialisation, you should exit with a non-zero exit code.
- The backend is guaranteed to call and complete the initialise function before any other functions are called.